summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-06-15 14:57:14 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-06-15 14:57:14 +0000
commit0b408219ed5992a9c85dc86a452bf1ef5faf0fd2 (patch)
treedc62519a18dd7b274c2d283d56f49a0bb31906ab /lib
parent051b8dc4e3d055f7ac848a80d26bf1e6e0af2e24 (diff)
parent58821ebbb4fa1bbd280749ca2f64d7592a852c98 (diff)
downloadgitlab-ce-0b408219ed5992a9c85dc86a452bf1ef5faf0fd2.tar.gz
Merge branch 'deprecate-gitaly-path' into 'master'
Stop using deprecated `path` field on Gitaly messages See merge request !12112
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitaly_client/util.rb1
-rw-r--r--lib/tasks/gitlab/gitaly.rake20
2 files changed, 10 insertions, 11 deletions
diff --git a/lib/gitlab/gitaly_client/util.rb b/lib/gitlab/gitaly_client/util.rb
index 86d055d3533..f5a4c5493ef 100644
--- a/lib/gitlab/gitaly_client/util.rb
+++ b/lib/gitlab/gitaly_client/util.rb
@@ -4,7 +4,6 @@ module Gitlab
class << self
def repository(repository_storage, relative_path)
Gitaly::Repository.new(
- path: File.join(Gitlab.config.repositories.storages[repository_storage]['path'], relative_path),
storage_name: repository_storage,
relative_path: relative_path
)
diff --git a/lib/tasks/gitlab/gitaly.rake b/lib/tasks/gitlab/gitaly.rake
index 3c5bc0146a1..e88111c3725 100644
--- a/lib/tasks/gitlab/gitaly.rake
+++ b/lib/tasks/gitlab/gitaly.rake
@@ -30,11 +30,7 @@ namespace :gitlab do
puts "# Gitaly storage configuration generated from #{Gitlab.config.source} on #{Time.current.to_s(:long)}"
puts "# This is in TOML format suitable for use in Gitaly's config.toml file."
- config = Gitlab.config.repositories.storages.map do |key, val|
- { name: key, path: val['path'] }
- end
-
- puts TOML.dump(storage: config)
+ puts gitaly_configuration_toml
end
private
@@ -42,10 +38,10 @@ namespace :gitlab do
# We cannot create config.toml files for all possible Gitaly configuations.
# For instance, if Gitaly is running on another machine then it makes no
# sense to write a config.toml file on the current machine. This method will
- # only write a config.toml file in the most common and simplest case: the
- # case where we have exactly one Gitaly process and we are sure it is
- # running locally because it uses a Unix socket.
- def create_gitaly_configuration
+ # 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.
+ def gitaly_configuration_toml
storages = []
address = nil
@@ -63,8 +59,12 @@ namespace :gitlab do
storages << { name: key, path: val['path'] }
end
+ TOML.dump(socket_path: address.sub(%r{\Aunix:}, ''), storage: storages)
+ end
+
+ def create_gitaly_configuration
File.open("config.toml", "w") do |f|
- f.puts TOML.dump(socket_path: address.sub(%r{\Aunix:}, ''), storages: storages)
+ f.puts gitaly_configuration_toml
end
rescue ArgumentError => e
puts "Skipping config.toml generation:"