X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/d6ed0a8d7822828b12aa2c90c6bcc62f780c2fa5..e2b8e67f5e107ab3eca8c022e360b27f7564e90d:/cookbooks/web/resources/rails_port.rb diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index ca3fd8c06..913f0a17f 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -125,6 +125,7 @@ action :create do user new_resource.user group new_resource.group notifies :run, "execute[#{rails_directory}/Gemfile]" + notifies :run, "execute[#{rails_directory}/app/assets/javascripts/i18n]" notifies :run, "execute[#{rails_directory}/public/assets]" notifies :delete, "file[#{rails_directory}/public/export/embed.html]" notifies :restart, "passenger_application[#{rails_directory}]" @@ -320,6 +321,16 @@ action :create do only_if { new_resource.run_migrations } end + execute "#{rails_directory}/app/assets/javascripts/i18n" do + action :nothing + command "bundle#{new_resource.ruby} exec rake i18n:js:export" + environment "RAILS_ENV" => "production" + cwd rails_directory + user new_resource.user + group new_resource.group + notifies :run, "execute[#{rails_directory}/public/assets]" + end + execute "#{rails_directory}/public/assets" do action :nothing command "bundle#{new_resource.ruby} exec rake assets:precompile" @@ -334,7 +345,10 @@ action :create do action :nothing end - passenger_application rails_directory + passenger_application rails_directory do + action :nothing + only_if { ::File.exist?("/usr/bin/passenger-config") } + end template "/etc/cron.daily/rails-#{new_resource.site.tr('.', '-')}" do cookbook "web"