summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-09-12 12:26:59 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-10-05 14:11:32 +0200
commit4656283c5cd10116d79812db24c37ff79b0e0273 (patch)
treebc66bc0e89178eb36c2d6bbcf80c2f0c4fb6170e /lib/tasks
parent905d3ed4292e6b274ac51b26b3b3577087c5f737 (diff)
downloadgitlab-ce-4656283c5cd10116d79812db24c37ff79b0e0273.tar.gz
Gitaly namespace service enabled for GitLab
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/gitaly.rake7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/gitaly.rake b/lib/tasks/gitlab/gitaly.rake
index 08677a98fc1..8377fe3269d 100644
--- a/lib/tasks/gitlab/gitaly.rake
+++ b/lib/tasks/gitlab/gitaly.rake
@@ -50,6 +50,8 @@ namespace :gitlab do
# only generate a configuration for the most common and simplest case: when
# we have exactly one Gitaly process and we are sure it is running locally
# because it uses a Unix socket.
+ # For development and testing purposes, an extra storage is added to gitaly,
+ # which is not known to Rails, but must be explicitly stubbed.
def gitaly_configuration_toml(gitaly_ruby: true)
storages = []
address = nil
@@ -67,6 +69,11 @@ namespace :gitlab do
storages << { name: key, path: val['path'] }
end
+
+ if Rails.env.test?
+ storages << { name: 'test_second_storage', path: Rails.root.join('tmp', 'tests', 'second_storage').to_s }
+ end
+
config = { socket_path: address.sub(%r{\Aunix:}, ''), storage: storages }
config[:auth] = { token: 'secret' } if Rails.env.test?
config[:'gitaly-ruby'] = { dir: File.join(Dir.pwd, 'ruby') } if gitaly_ruby