diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-15 06:28:44 +0000 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-15 06:28:44 +0000 |
| commit | ecae936d344b7d29f1898f81ac283d444c086f0d (patch) | |
| tree | 32fcbcbdd74a6a804434057811ddb1df69eaf7d2 /lib/tasks | |
| parent | 66a484c9cdb6b35801aa09a95e7295043e0d52ac (diff) | |
| parent | 090ed21e6f53ade25716fb0b406f25b93b6a7690 (diff) | |
| download | gitlab-ce-ecae936d344b7d29f1898f81ac283d444c086f0d.tar.gz | |
Merge branch 'batch_key_import' into 'master'
Batch Key Import
Diffstat (limited to 'lib/tasks')
| -rw-r--r-- | lib/tasks/gitlab/check.rake | 2 | ||||
| -rw-r--r-- | lib/tasks/gitlab/shell.rake | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 2b158fe14ee..c2e6cd1be78 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -727,7 +727,7 @@ namespace :gitlab do end def check_gitlab_shell - required_version = Gitlab::VersionInfo.new(1, 8, 4) + required_version = Gitlab::VersionInfo.new(1, 8, 5) current_version = Gitlab::VersionInfo.parse(gitlab_shell_version) print "GitLab Shell version >= #{required_version} ? ... " 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 |
