]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/resources/rails_port.rb
Update bundle
[chef.git] / cookbooks / web / resources / rails_port.rb
index ca3fd8c065c18cdd6aaddea6033ce8507ff79a42..067c1334c2ef6a01dede62dd9e7db1bf4297022f 100644 (file)
@@ -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"