Commit c655cc898316c73bd10a979bdeb5d3f48bd5e102
1 parent
2aa0155f
Exists in
master
and in
17 other branches
Add a git_data_dir global configuration option
Showing
1 changed file
with
12 additions
and
0 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/libraries/gitlab.rb
... | ... | @@ -31,11 +31,13 @@ module Gitlab |
31 | 31 | postgresql Mash.new |
32 | 32 | redis Mash.new |
33 | 33 | gitlab_rails Mash.new |
34 | + gitlab_shell Mash.new | |
34 | 35 | unicorn Mash.new |
35 | 36 | sidekiq Mash.new |
36 | 37 | nginx Mash.new |
37 | 38 | node nil |
38 | 39 | external_url nil |
40 | + git_data_dir nil | |
39 | 41 | |
40 | 42 | class << self |
41 | 43 | |
... | ... | @@ -103,6 +105,14 @@ module Gitlab |
103 | 105 | Gitlab['gitlab_rails']['gitlab_port'] = uri.port |
104 | 106 | end |
105 | 107 | |
108 | + def parse_git_data_dir | |
109 | + return unless git_data_dir | |
110 | + | |
111 | + Gitlab['gitlab_shell']['git_data_directory'] ||= git_data_dir | |
112 | + Gitlab['gitlab_rails']['gitlab_shell_repos_path'] ||= File.join(git_data_dir, "repositories") | |
113 | + Gitlab['gitlab_rails']['satellites_path'] ||= File.join(git_data_dir, "gitlab-satellites") | |
114 | + end | |
115 | + | |
106 | 116 | def generate_hash |
107 | 117 | results = { "gitlab" => {} } |
108 | 118 | [ |
... | ... | @@ -110,6 +120,7 @@ module Gitlab |
110 | 120 | "user", |
111 | 121 | "redis", |
112 | 122 | "gitlab_rails", |
123 | + "gitlab_shell", | |
113 | 124 | "unicorn", |
114 | 125 | "sidekiq", |
115 | 126 | "nginx", |
... | ... | @@ -125,6 +136,7 @@ module Gitlab |
125 | 136 | def generate_config(node_name) |
126 | 137 | generate_secrets(node_name) |
127 | 138 | parse_external_url |
139 | + parse_git_data_dir | |
128 | 140 | generate_hash |
129 | 141 | end |
130 | 142 | end | ... | ... |