From aa0b982b14668f71d2eafef5f0aeef6923904cd4 Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Tue, 8 Dec 2015 10:36:46 -0200 Subject: [PATCH] precompile assets now idempotent --- cookbooks/gitlab/recipes/default.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cookbooks/gitlab/recipes/default.rb b/cookbooks/gitlab/recipes/default.rb index 001bed9..3993256 100644 --- a/cookbooks/gitlab/recipes/default.rb +++ b/cookbooks/gitlab/recipes/default.rb @@ -100,8 +100,14 @@ execute 'selinux-gitlab' do end execute 'fix-relative-url-for-assets' do + command 'sed -i \'s/# config.relative_url_root = "\/gitlab"/config.relative_url_root = "\/gitlab"/\' /usr/lib/gitlab/config/application.rb' + only_if 'grep -q "# config.relative_url_root" /usr/lib/gitlab/config/application.rb' + notifies :run, 'execute[precompile-assets]' +end + +execute 'precompile-assets' do user 'git' cwd '/usr/lib/gitlab' - command 'sed -i \'s/# config.relative_url_root = "\/gitlab"/config.relative_url_root = "\/gitlab"/\' /usr/lib/gitlab/config/application.rb' command 'bundle exec rake assets:precompile RAILS_ENV=production' + action :nothing end -- libgit2 0.21.2