gitlab-org--gitlab-foss/lib/tasks/gitlab/dev.rake
Rémy Coutable b2373e3d6c
Ensure the ee-compat-check uses the correct patch URL for forks
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-31 17:44:07 +01:00

30 lines
757 B
Ruby

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