debian-mirror-gitlab/lib/tasks/gitlab/dev.rake

32 lines
758 B
Ruby
Raw Normal View History

2016-11-03 12:29:30 +05:30
namespace :gitlab do
namespace :dev do
desc 'Checks if the branch would apply cleanly to EE'
2017-08-17 22:00:37 +05:30
task :ee_compat_check, [:branch] => :environment do |_, args|
opts =
if ENV['CI']
2018-03-17 18:26:18 +05:30
{
ce_project_url: ENV['CI_PROJECT_URL'],
branch: ENV['CI_COMMIT_REF_NAME'],
job_id: ENV['CI_JOB_ID']
}
2017-08-17 22:00:37 +05:30
else
unless args[:branch]
puts "Must specify a branch as an argument".color(:red)
exit 1
end
2018-03-17 18:26:18 +05:30
2017-08-17 22:00:37 +05:30
args
2016-11-03 12:29:30 +05:30
end
2018-03-17 18:26:18 +05:30
if File.basename(Rails.root) == 'gitlab-ee'
puts "Skipping EE projects"
exit 0
elsif Gitlab::EeCompatCheck.new(opts || {}).check
2017-08-17 22:00:37 +05:30
exit 0
else
exit 1
2016-11-03 12:29:30 +05:30
end
end
end
end