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,11 +31,13 @@ module Gitlab | ||
| 31 | postgresql Mash.new | 31 | postgresql Mash.new |
| 32 | redis Mash.new | 32 | redis Mash.new |
| 33 | gitlab_rails Mash.new | 33 | gitlab_rails Mash.new |
| 34 | + gitlab_shell Mash.new | ||
| 34 | unicorn Mash.new | 35 | unicorn Mash.new |
| 35 | sidekiq Mash.new | 36 | sidekiq Mash.new |
| 36 | nginx Mash.new | 37 | nginx Mash.new |
| 37 | node nil | 38 | node nil |
| 38 | external_url nil | 39 | external_url nil |
| 40 | + git_data_dir nil | ||
| 39 | 41 | ||
| 40 | class << self | 42 | class << self |
| 41 | 43 | ||
| @@ -103,6 +105,14 @@ module Gitlab | @@ -103,6 +105,14 @@ module Gitlab | ||
| 103 | Gitlab['gitlab_rails']['gitlab_port'] = uri.port | 105 | Gitlab['gitlab_rails']['gitlab_port'] = uri.port |
| 104 | end | 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 | def generate_hash | 116 | def generate_hash |
| 107 | results = { "gitlab" => {} } | 117 | results = { "gitlab" => {} } |
| 108 | [ | 118 | [ |
| @@ -110,6 +120,7 @@ module Gitlab | @@ -110,6 +120,7 @@ module Gitlab | ||
| 110 | "user", | 120 | "user", |
| 111 | "redis", | 121 | "redis", |
| 112 | "gitlab_rails", | 122 | "gitlab_rails", |
| 123 | + "gitlab_shell", | ||
| 113 | "unicorn", | 124 | "unicorn", |
| 114 | "sidekiq", | 125 | "sidekiq", |
| 115 | "nginx", | 126 | "nginx", |
| @@ -125,6 +136,7 @@ module Gitlab | @@ -125,6 +136,7 @@ module Gitlab | ||
| 125 | def generate_config(node_name) | 136 | def generate_config(node_name) |
| 126 | generate_secrets(node_name) | 137 | generate_secrets(node_name) |
| 127 | parse_external_url | 138 | parse_external_url |
| 139 | + parse_git_data_dir | ||
| 128 | generate_hash | 140 | generate_hash |
| 129 | end | 141 | end |
| 130 | end | 142 | end |