gitlab-org--gitlab-foss/lib/tasks/gitlab/dev.rake
Lin Jen-Shin 6be736a7d2 Enable ee_compat_check for forks, but not EE
We exclude known EE projects, and check the project directory
name for EE forks.
2017-09-15 02:06:48 +08:00

26 lines
646 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']
{ branch: ENV['CI_COMMIT_REF_NAME'] }
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