From: Tom Hughes Date: Tue, 28 Aug 2018 17:12:34 +0000 (+0100) Subject: Run i18n:js:export rake task on web site updates X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/f2c65737901325f23db479f250b502c3525172f3?ds=inline Run i18n:js:export rake task on web site updates --- diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index 778d24ff4..17dfe641d 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -125,7 +125,7 @@ action :create do user new_resource.user group new_resource.group notifies :run, "execute[#{rails_directory}/Gemfile]" - notifies :run, "execute[#{rails_directory}/public/assets]" + notifies :run, "execute[#{rails_directory}/app/assets/javascripts/i18n]" notifies :delete, "file[#{rails_directory}/public/export/embed.html]" notifies :restart, "passenger_application[#{rails_directory}]" end @@ -320,6 +320,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"