2016-09-29 13:31:14 -04:00
|
|
|
namespace :gitlab do
|
|
|
|
namespace :dev do
|
|
|
|
desc 'Checks if the branch would apply cleanly to EE'
|
2016-10-28 12:13:59 -04:00
|
|
|
task :ee_compat_check, [:branch] => :environment do |_, args|
|
|
|
|
opts =
|
|
|
|
if ENV['CI']
|
2017-10-06 06:20:03 -04:00
|
|
|
{
|
2017-10-31 09:24:45 -04:00
|
|
|
ce_project_url: ENV['CI_PROJECT_URL'],
|
|
|
|
branch: ENV['CI_COMMIT_REF_NAME'],
|
|
|
|
job_id: ENV['CI_JOB_ID']
|
2017-10-06 06:20:03 -04:00
|
|
|
}
|
2016-10-28 12:13:59 -04:00
|
|
|
else
|
|
|
|
unless args[:branch]
|
|
|
|
puts "Must specify a branch as an argument".color(:red)
|
|
|
|
exit 1
|
|
|
|
end
|
2018-01-11 11:34:01 -05:00
|
|
|
|
2016-10-28 12:13:59 -04:00
|
|
|
args
|
|
|
|
end
|
2016-10-07 11:21:51 -04:00
|
|
|
|
2017-09-11 11:15:41 -04:00
|
|
|
if File.basename(Rails.root) == 'gitlab-ee'
|
|
|
|
puts "Skipping EE projects"
|
|
|
|
exit 0
|
|
|
|
elsif Gitlab::EeCompatCheck.new(opts || {}).check
|
2016-10-17 12:52:14 -04:00
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
2016-09-29 13:31:14 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|