- execute rails_directory do
- action :nothing
- command "passenger-config restart-app #{rails_directory}"
- user "root"
- group "root"
- only_if { File.exist?("/usr/bin/passenger-config") }
- end
-
- file "#{rails_directory}/public/export/embed.html" do
- action :nothing
- end
-
- execute "#{rails_directory}/public/assets" do
- action :nothing
- command "bundle#{ruby_version} exec rake#{ruby_version} assets:precompile"
- environment "RAILS_ENV" => "production"
- cwd rails_directory
- user rails_user
- group rails_group
- notifies :delete, "file[#{rails_directory}/public/export/embed.html]", :immediate
- notifies :run, "execute[#{rails_directory}]", :immediate
- end
-
- execute "#{rails_directory}/db/migrate" do
- action :nothing
- command "bundle#{ruby_version} exec rake#{ruby_version} db:migrate"
- cwd rails_directory
- user rails_user
- group rails_group
- notifies :run, "execute[#{rails_directory}/public/assets]", :immediate
- end
-
- execute "#{rails_directory}/Gemfile" do
- action :nothing
- command "bundle#{ruby_version} install"
- cwd rails_directory
- user "root"
- group "root"
- environment "NOKOGIRI_USE_SYSTEM_LIBRARIES" => "yes"
- if run_migrations
- notifies :run, "execute[#{rails_directory}/db/migrate]", :immediate
- else
- notifies :run, "execute[#{rails_directory}/public/assets]", :immediate
- end
- subscribes :run, "gem_package[bundler#{ruby_version}]"
- end
-