Created
August 21, 2009 17:48
-
-
Save ideaoforder/172240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :deploy do | |
| task :start do | |
| restart_monit | |
| sudo "monit -g #{application} start all" | |
| START WEB SERVER (mongrels, thins, litespeed, whatever) | |
| end | |
| task :stop do | |
| restart_monit | |
| sudo "monit -g #{application} stop all" | |
| STOP WEB SERVER (mongrels, thins, litespeed, whatever) | |
| end | |
| task :restart do | |
| restart_monit | |
| sudo "monit -g #{application} restart all" | |
| RESTART WEB SERVER (mongrels, thins, litespeed, whatever) | |
| run "echo \"Website has been deployed\"" | |
| end | |
| # # This hasn't been tested! Use with caution! | |
| # desc "Copy monit configuration" | |
| # task :copy_monit_cfg do | |
| # #sudo "rm -rf /etc/monit.d/#{application}" | |
| # #sudo "mkdir -p /etc/monit.d/#{application}" | |
| # #sudo "cp #{release_path}/shared/monit/* /etc/monit.d/#{application}" | |
| # end | |
| desc "Stop monit" | |
| task :stop_monit do | |
| sudo "/etc/init.d/monit stop" | |
| end | |
| desc "Start monit" | |
| task :start_monit do | |
| sudo "/etc/init.d/monit start" | |
| end | |
| desc "Restart monit" | |
| task :restart_monit do | |
| stop_monit | |
| run "sleep 5" | |
| start_monit | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment