diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-04 17:06:07 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-04 20:35:35 +0300 |
commit | 62521f20e4bfead7b224ea9067be9733fc6e2f90 (patch) | |
tree | 8df484fb82fcdd0bbd4afa6b905ed9918e55dcf4 /lib/tasks | |
parent | 5efd67942cec39d733d27a52edc2ebc86babce30 (diff) |
Add rake task that prints TOML storage configuration
Closes gitaly#173
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/gitaly.rake | 14 |
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 |