summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-04-07 21:58:19 +0000
committerRobert Speicher <robert@gitlab.com>2017-04-07 21:58:19 +0000
commit33a050d31cc657bdcc03e8cd971451b47bbadacf (patch)
tree691ab8de200d2f356dda3e10de4475c1ffa1c909 /lib
parent60ec9c8dbbe6ac975ffbd52a1919cd82104bda00 (diff)
parent62521f20e4bfead7b224ea9067be9733fc6e2f90 (diff)
downloadgitlab-ce-33a050d31cc657bdcc03e8cd971451b47bbadacf.tar.gz
Merge branch 'feature/add-rake-task-prints-storage-config-in-toml' into 'master'
Add rake task that prints TOML storage configuration Closes gitaly#173 See merge request !10448
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/gitlab/gitaly.rake14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/gitaly.rake b/lib/tasks/gitlab/gitaly.rake
index c288e17ac8d..9f6cfe3957c 100644
--- a/lib/tasks/gitlab/gitaly.rake
+++ b/lib/tasks/gitlab/gitaly.rake
@@ -19,5 +19,19 @@ namespace :gitlab do
run_command!([command])
end
end
+
+ desc "GitLab | Print storage configuration in TOML format"
+ task storage_config: :environment do
+ require 'toml'
+
+ 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)
+ end
end
end