summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2017-04-04 16:06:07 +0200
committerAhmad Sherif <me@ahmadsherif.com>2017-04-04 19:35:35 +0200
commit62521f20e4bfead7b224ea9067be9733fc6e2f90 (patch)
tree8df484fb82fcdd0bbd4afa6b905ed9918e55dcf4 /lib/tasks
parent5efd67942cec39d733d27a52edc2ebc86babce30 (diff)
downloadgitlab-ce-62521f20e4bfead7b224ea9067be9733fc6e2f90.tar.gz
Add rake task that prints TOML storage configurationfeature/add-rake-task-prints-storage-config-in-toml
Closes gitaly#173
Diffstat (limited to 'lib/tasks')
-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