X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/d6ed0a8d7822828b12aa2c90c6bcc62f780c2fa5..1ba789e232a546639baaf55c49a14eb474647e88:/cookbooks/web/resources/rails_port.rb diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index ca3fd8c06..067c1334c 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,9 @@ action :create do action :nothing end - passenger_application rails_directory + passenger_application rails_directory do + only_if { ::File.exist?("/usr/bin/passenger-config") } + end template "/etc/cron.daily/rails-#{new_resource.site.tr('.', '-')}" do cookbook "web"