diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-04 16:06:07 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2017-04-04 19:35:35 +0200 |
commit | 62521f20e4bfead7b224ea9067be9733fc6e2f90 (patch) | |
tree | 8df484fb82fcdd0bbd4afa6b905ed9918e55dcf4 /lib/tasks | |
parent | 5efd67942cec39d733d27a52edc2ebc86babce30 (diff) | |
download | gitlab-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.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 |