Commit 431d83ddbd5fbf2638883fa07ad4ab5f1299945e

Authored by Sergio Oliveira
Committed by Paulo Tada
1 parent 384b4d92
Exists in mezuro_cookbook

precompile assets now idempotent

Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Signed-off-by: Sergio Oliveira <seocam@seocam.com>
Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
cookbooks/gitlab/recipes/default.rb
... ... @@ -100,8 +100,14 @@ execute &#39;selinux-gitlab&#39; do
100 100 end
101 101  
102 102 execute 'fix-relative-url-for-assets' do
  103 + command 'sed -i \'s/# config.relative_url_root = "\/gitlab"/config.relative_url_root = "\/gitlab"/\' /usr/lib/gitlab/config/application.rb'
  104 + only_if 'grep -q "# config.relative_url_root" /usr/lib/gitlab/config/application.rb'
  105 + notifies :run, 'execute[precompile-assets]'
  106 +end
  107 +
  108 +execute 'precompile-assets' do
103 109 user 'git'
104 110 cwd '/usr/lib/gitlab'
105   - command 'sed -i \'s/# config.relative_url_root = "\/gitlab"/config.relative_url_root = "\/gitlab"/\' /usr/lib/gitlab/config/application.rb'
106 111 command 'bundle exec rake assets:precompile RAILS_ENV=production'
  112 + action :nothing
107 113 end
... ...