Redo autostart script to start from user. Write doc. Refactor bluepill capistrano recipe. Refs #1
This commit is contained in:
parent
697e9df87e
commit
e7bf100806
|
@ -2,7 +2,7 @@
|
|||
|
||||
for f in `ls /srv`
|
||||
do
|
||||
sudo -u rosa APP_NAME=$f bundle exec bluepill --no-privileged load /srv/$f/current/config/production.pill
|
||||
su -l rosa -c "cd /srv/$f/current && APP_NAME=$f bundle exec bluepill --no-privileged load /srv/$f/current/config/production.pill"
|
||||
done
|
||||
|
||||
/srv/rosa_build/current/bin/mount_downloads.sh
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
=== Basic bootstrap
|
||||
* rake db:drop db:setup
|
||||
==
|
||||
|
||||
=== Setup autostart
|
||||
Add to /etc/rc.d/rc.local following /srv/rosa_build/current/bin/autostart.sh
|
||||
==
|
||||
|
||||
|
|
|
@ -2,20 +2,25 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|||
namespace :bluepill do
|
||||
set(:bluepill_binary) {"APP_NAME=#{fetch :application} bundle exec bluepill --no-privileged"}
|
||||
|
||||
desc "Stop processes that bluepill is monitoring and quit bluepill"
|
||||
task :quit, :roles => [:app], :on_error => :continue do
|
||||
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} stop"
|
||||
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} quit"
|
||||
end
|
||||
|
||||
desc "Load bluepill configuration and start it"
|
||||
task :start, :roles => [:app] do
|
||||
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} load config/production.pill"
|
||||
end
|
||||
|
||||
desc "Stop processes that bluepill is monitoring"
|
||||
task :stop, :roles => [:app], :on_error => :continue do
|
||||
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} stop"
|
||||
end
|
||||
|
||||
task :restart, :roles => [:app] do
|
||||
quit
|
||||
start
|
||||
# run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} restart #{fetch :application}"
|
||||
stop; start
|
||||
end
|
||||
|
||||
desc "Stop processes that bluepill is monitoring and quit bluepill"
|
||||
task :quit, :roles => [:app] do
|
||||
# stop
|
||||
run "cd #{fetch :current_path} && #{try_sudo} #{bluepill_binary} quit"
|
||||
end
|
||||
|
||||
desc "Prints bluepills monitored processes statuses"
|
||||
|
|
Loading…
Reference in New Issue