Commit d68b16d1da8549bd55b1d122f054eaf690819afe
1 parent
cdb91575
Exists in
master
and in
17 other branches
Also create the log directory for gitlab-shell
Showing
2 changed files
with
7 additions
and
2 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
| @@ -3,6 +3,7 @@ git_group = node['gitlab']['user']['group'] | @@ -3,6 +3,7 @@ git_group = node['gitlab']['user']['group'] | ||
| 3 | gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell" | 3 | gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell" |
| 4 | repositories_path = node['gitlab']['gitlab-core']['repositories_path'] | 4 | repositories_path = node['gitlab']['gitlab-core']['repositories_path'] |
| 5 | ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") | 5 | ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") |
| 6 | +log_directory = node['gitlab']['gitlab-shell']['log_directory'] | ||
| 6 | 7 | ||
| 7 | # Create directories because the git_user does not own its home directory | 8 | # Create directories because the git_user does not own its home directory |
| 8 | directory repositories_path do | 9 | directory repositories_path do |
| @@ -16,6 +17,10 @@ directory ssh_dir do | @@ -16,6 +17,10 @@ directory ssh_dir do | ||
| 16 | mode "0700" | 17 | mode "0700" |
| 17 | end | 18 | end |
| 18 | 19 | ||
| 20 | +directory log_directory do | ||
| 21 | + owner git_user | ||
| 22 | +end | ||
| 23 | + | ||
| 19 | template File.join(gitlab_shell_dir, "config.yml") do | 24 | template File.join(gitlab_shell_dir, "config.yml") do |
| 20 | source "gitlab-shell-config.yml.erb" | 25 | source "gitlab-shell-config.yml.erb" |
| 21 | owner git_user | 26 | owner git_user |
| @@ -26,7 +31,7 @@ template File.join(gitlab_shell_dir, "config.yml") do | @@ -26,7 +31,7 @@ template File.join(gitlab_shell_dir, "config.yml") do | ||
| 26 | :repositories_path => repositories_path, | 31 | :repositories_path => repositories_path, |
| 27 | :ssh_dir => ssh_dir, | 32 | :ssh_dir => ssh_dir, |
| 28 | :redis_port => node['gitlab']['redis']['port'], | 33 | :redis_port => node['gitlab']['redis']['port'], |
| 29 | - :log_directory => node['gitlab']['gitlab-shell']['log_directory'] | 34 | + :log_file => File.join(log_directory, "gitlab-shell.log") |
| 30 | ) | 35 | ) |
| 31 | notifies :run, "execute[bin/install]" | 36 | notifies :run, "execute[bin/install]" |
| 32 | end | 37 | end |
files/gitlab-cookbooks/gitlab/templates/default/gitlab-shell-config.yml.erb
| @@ -30,7 +30,7 @@ redis: | @@ -30,7 +30,7 @@ redis: | ||
| 30 | 30 | ||
| 31 | # Log file. | 31 | # Log file. |
| 32 | # Default is gitlab-shell.log in the root directory. | 32 | # Default is gitlab-shell.log in the root directory. |
| 33 | -log_file: "<%= @log_directory %>/gitlab-shell.log" | 33 | +log_file: "<%= @log_file %>" |
| 34 | 34 | ||
| 35 | # Log level. INFO by default | 35 | # Log level. INFO by default |
| 36 | log_level: INFO | 36 | log_level: INFO |