- file "#{rails_directory}/tmp/restart.txt" do
- action :nothing
- end
-
- file "#{rails_directory}/public/export/embed.html" do
- action :nothing
- end
-
- execute "#{rails_directory}/public/assets" do
- action :nothing
- command "rake#{ruby_version} assets:precompile"
- environment "RAILS_ENV" => "production"
- cwd rails_directory
- user rails_user
- group rails_group
- notifies :delete, resources(:file => "#{rails_directory}/public/export/embed.html")
- notifies :touch, resources(:file => "#{rails_directory}/tmp/restart.txt")
- end
-
- execute "#{rails_directory}/db/migrate" do
- action :nothing
- command "rake#{ruby_version} db:migrate"
- cwd rails_directory
- user rails_user
- group rails_group
- notifies :run, resources(:execute => "#{rails_directory}/public/assets")
- end
-
- execute "#{rails_directory}/Gemfile" do
- action :nothing
- command "bundle#{ruby_version} install"
- cwd rails_directory
- user "root"
- group "root"
- if run_migrations
- notifies :run, resources(:execute => "#{rails_directory}/db/migrate")
- else
- notifies :run, resources(:execute => "#{rails_directory}/public/assets")
- end
- subscribes :run, resources(:gem_package => "bundler#{ruby_version}")
- end
-