2016-09-29 17:31:14 +00:00
|
|
|
namespace :gitlab do
|
|
|
|
namespace :dev do
|
|
|
|
desc 'Checks if the branch would apply cleanly to EE'
|
2016-10-28 16:13:59 +00:00
|
|
|
task :ee_compat_check, [:branch] => :environment do |_, args|
|
|
|
|
opts =
|
|
|
|
if ENV['CI']
|
2017-10-06 10:20:03 +00:00
|
|
|
{
|
2017-10-17 14:12:00 +00:00
|
|
|
# We don't use CI_REPOSITORY_URL since it includes `gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@`
|
|
|
|
# which is confusing in the steps suggested in the job's output.
|
|
|
|
ce_repo: "#{ENV['CI_PROJECT_URL']}.git",
|
2017-10-06 10:20:03 +00:00
|
|
|
branch: ENV['CI_COMMIT_REF_NAME']
|
|
|
|
}
|
2016-10-28 16:13:59 +00:00
|
|
|
else
|
|
|
|
unless args[:branch]
|
|
|
|
puts "Must specify a branch as an argument".color(:red)
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
args
|
|
|
|
end
|
2016-10-07 15:21:51 +00:00
|
|
|
|
2017-09-11 15:15:41 +00:00
|
|
|
if File.basename(Rails.root) == 'gitlab-ee'
|
|
|
|
puts "Skipping EE projects"
|
|
|
|
exit 0
|
|
|
|
elsif Gitlab::EeCompatCheck.new(opts || {}).check
|
2016-10-17 16:52:14 +00:00
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
exit 1
|
2016-09-29 17:31:14 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|