Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-03-13 21:32:30 +0400
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-03-14 18:49:11 +0400
commit779fa4a7b7f2eef7910509df1787412844a3b3b8 (patch)
tree04c21842228161862f4f83ffd62c453deff2f2f6 /lib/tasks/gitlab/shell.rake
parent17a9ecf8cf6724613b38c08040bdb786ffe30718 (diff)
Use batch_add_keys in `rake gitlab:shell:setup`
Diffstat (limited to 'lib/tasks/gitlab/shell.rake')
-rw-r--r--lib/tasks/gitlab/shell.rake12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index 0d7a390bc92..08de0f2dd5d 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -34,14 +34,18 @@ namespace :gitlab do
Gitlab::Shell.new.remove_all_keys
- Key.find_each(batch_size: 1000) do |key|
- if Gitlab::Shell.new.add_key(key.shell_id, key.key)
+ Gitlab::Shell.new.batch_add_keys do |adder|
+ Key.find_each(batch_size: 1000) do |key|
+ adder.add_key(key.shell_id, key.key)
print '.'
- else
- print 'F'
end
end
+ unless $?.success?
+ puts "Failed to add keys...".red
+ exit 1
+ end
+
rescue Gitlab::TaskAbortedByUserError
puts "Quitting...".red
exit 1