Permalink
Browse files

invoke `play deps' before start running. deployment and runtime users…

… may be different.
  • Loading branch information...
1 parent 95b2686 commit 82aecee37d3192a77d389b09192486b3c4205155 Yamashita Yuu committed Feb 8, 2012
Showing with 16 additions and 4 deletions.
  1. +16 −4 conf/play-recipes.rb
View
@@ -42,6 +42,7 @@
end
after 'deploy:setup', 'play:setup'
+after 'deploy:update', 'play:update'
namespace :play do
_cset :play_version, '1.2.4'
@@ -131,11 +132,11 @@
task :start, :roles => :app, :except => { :no_release => true } do
run "rm -f #{play_pid_file}" # FIXME: should check if the pid is active
- run "cd #{current_path} && nohup #{play_cmd} start -Xss2048k --deps --pid_file=#{play_pid_file} --%prod"
+ run "cd #{release_path} && nohup #{play_cmd} start -Xss2048k --pid_file=#{play_pid_file} --%prod"
end
task :stop, :roles => :app, :except => { :no_release => true } do
- run "cd #{current_path} && #{play_cmd} stop --pid_file=#{play_pid_file}"
+ run "cd #{release_path} && #{play_cmd} stop --pid_file=#{play_pid_file}"
end
task :restart, :roles => :app, :except => { :no_release => true } do
@@ -144,7 +145,7 @@
end
task :status, :roles => :app, :except => { :no_release => true } do
- run "cd #{current_path} && #{play_cmd} status --pid_file=#{play_pid_file}"
+ run "cd #{release_path} && #{play_cmd} status --pid_file=#{play_pid_file}"
end
end
@@ -156,7 +157,7 @@
File.join('/etc', 'init', "#{play_upstart_service}.conf")
end
_cset :play_upstart_config_template, File.join(File.dirname(__FILE__), 'templates', 'upstart.erb')
- _cset :play_upstart_options, %w(--deps)
+ _cset :play_upstart_options, []
_cset :play_upstart_runner do
user
end
@@ -188,6 +189,17 @@
end
end
+ desc "update play runtime environment"
+ task :update, :roles => :app, :except => { :no_release => true } do
+ transaction {
+ dependencies
+ }
+ end
+
+ task :dependencies, :roles => :app, :except => { :no_release => true } do
+ run "cd #{release_path} && #{play_cmd} dependencies --forProd"
+ end
+
desc "start play service"
task :start, :roles => :app, :except => { :no_release => true } do
play_daemon.start

0 comments on commit 82aecee

Please sign in to comment.