From 30a1bf3ee616905c69bf77ef8fbc21c0da8f4d6d Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 5 Feb 2014 11:59:39 +0100 Subject: [PATCH] Delete checked-in empty directories --- files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb b/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb index 38008a3..4d5ee37 100644 --- a/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb +++ b/files/gitlab-cookbooks/gitlab/recipes/gitlab-core.rb @@ -74,12 +74,19 @@ unicorn_config File.join(gitlab_core_etc_dir, "unicorn.rb") do notifies :restart, 'service[gitlab-core]' if should_notify end -link "/opt/gitlab/embedded/service/gitlab-core/tmp" do - to gitlab_core_tmp_dir -end +# replace empty directories in the Git repo with symlinks to /var/opt/gitlab +{ + "/opt/gitlab/embedded/service/gitlab-core/tmp" => gitlab_core_tmp_dir, + "/opt/gitlab/embedded/service/gitlab-core/log" => gitlab_core_log_dir +}.each do |link_dir, target_dir| + directory link_dir do + action :delete + recursive true + end -link "/opt/gitlab/embedded/service/gitlab-core/log" do - to gitlab_core_log_dir + link link_dir do + to target_dir + end end execute "chown -R #{node['gitlab']['user']['username']} /opt/gitlab/embedded/service/gitlab-core/public" -- libgit2 0.21.2