Commit 430d3ad4 authored by Riyad Preukschas's avatar Riyad Preukschas

Update output of gitlab:enable_automerge

parent 224da711
namespace :gitlab do namespace :gitlab do
desc "GITLAB | Enable auto merge" desc "GITLAB | Enable auto merge"
task :enable_automerge => :environment do task :enable_automerge => :environment do
warn_user_is_not_gitlab
puts "Updating repo permissions ..."
Gitlab::Gitolite.new.enable_automerge Gitlab::Gitolite.new.enable_automerge
puts "... #{"done".green}"
puts ""
Project.find_each do |project| print "Creating satellites for ..."
if project.repo_exists? && !project.satellite.exists? unless Project.count > 0
puts "Creating satellite for #{project.name}...".green puts "skipping, because you have no projects".magenta
project.satellite.create return
end end
puts ""
Project.find_each(batch_size: 100) do |project|
print "#{project.name_with_namespace.yellow} ... "
unless project.repo_exists?
puts "skipping, because the repo is empty".magenta
next
end end
puts "Done!".green if project.satellite.exists?
puts "exists already".green
else
puts ""
project.satellite.create
print "... "
if $?.success?
puts "created".green
else
puts "error".red
end
end
end
end end
namespace :satellites do namespace :satellites do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment