diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-04-20 21:51:44 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-04-20 21:51:44 +0900 |
commit | 0a6b7caac8e23974385c9e4a900dd7eea07c44fd (patch) | |
tree | 6679b0f192947bd9f2a13a13e412567b7b59f9e3 /lib/tasks | |
parent | 1e817e0018af2c3fbb622ec74f02ae255e7be95f (diff) | |
parent | ef55bbd25400349aa9ec35e269f408f94ce5f890 (diff) | |
download | gitlab-ce-0a6b7caac8e23974385c9e4a900dd7eea07c44fd.tar.gz |
Merge branch 'master' into live-trace-v2
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/setup.rake | 11 | ||||
-rw-r--r-- | lib/tasks/gitlab/storage.rake | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake index 1d903c81358..f71e69987cb 100644 --- a/lib/tasks/gitlab/setup.rake +++ b/lib/tasks/gitlab/setup.rake @@ -1,9 +1,20 @@ namespace :gitlab do desc "GitLab | Setup production application" task setup: :gitlab_environment do + check_gitaly_connection setup_db end + def check_gitaly_connection + Gitlab.config.repositories.storages.each do |name, _details| + Gitlab::GitalyClient::ServerService.new(name).info + end + rescue GRPC::Unavailable => ex + puts "Failed to connect to Gitaly...".color(:red) + puts "Error: #{ex}" + exit 1 + end + def setup_db warn_user_is_not_gitlab diff --git a/lib/tasks/gitlab/storage.rake b/lib/tasks/gitlab/storage.rake index 8ac73bc8ff2..6e8bd9078c8 100644 --- a/lib/tasks/gitlab/storage.rake +++ b/lib/tasks/gitlab/storage.rake @@ -111,7 +111,7 @@ namespace :gitlab do puts " - #{project.full_path} (id: #{project.id})".color(:red) - return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator + return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator, Cop/AvoidReturnFromBlocks end end end @@ -132,7 +132,7 @@ namespace :gitlab do puts " - #{upload.path} (id: #{upload.id})".color(:red) - return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator + return if counter >= limit # rubocop:disable Lint/NonLocalExitFromIterator, Cop/AvoidReturnFromBlocks end end end |