Update output of gitlab:enable_automerge
This commit is contained in:
parent
224da71177
commit
430d3ad45b
|
@ -1,16 +1,42 @@
|
||||||
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
|
||||||
Gitlab::Gitolite.new.enable_automerge
|
warn_user_is_not_gitlab
|
||||||
|
|
||||||
Project.find_each do |project|
|
puts "Updating repo permissions ..."
|
||||||
if project.repo_exists? && !project.satellite.exists?
|
Gitlab::Gitolite.new.enable_automerge
|
||||||
puts "Creating satellite for #{project.name}...".green
|
puts "... #{"done".green}"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
print "Creating satellites for ..."
|
||||||
|
unless Project.count > 0
|
||||||
|
puts "skipping, because you have no projects".magenta
|
||||||
|
return
|
||||||
|
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
|
||||||
|
|
||||||
|
if project.satellite.exists?
|
||||||
|
puts "exists already".green
|
||||||
|
else
|
||||||
|
puts ""
|
||||||
project.satellite.create
|
project.satellite.create
|
||||||
|
|
||||||
|
print "... "
|
||||||
|
if $?.success?
|
||||||
|
puts "created".green
|
||||||
|
else
|
||||||
|
puts "error".red
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Done!".green
|
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :satellites do
|
namespace :satellites do
|
||||||
|
|
Loading…
Reference in a new issue