summaryrefslogtreecommitdiff
path: root/lib/tasks/gitlab/gitaly.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/gitlab/gitaly.rake')
-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