-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more common tasks to capistrano.rb; add tasks for niet & apache
- Loading branch information
Shevaun Coker
committed
May 29, 2012
1 parent
c0a5a77
commit 29f17af
Showing
5 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Easy | ||
module Deployment | ||
VERSION = "0.0.8" | ||
VERSION = "0.0.9" | ||
end | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Define some defaults for capistrano deploys. | ||
# To load this capistrano configuraiton, require 'easy/deployment/apache' from deploy.rb | ||
|
||
Capistrano::Configuration.instance(:must_exist).load do | ||
namespace :apache do | ||
desc "Configure this site & Reload the apache configuration" | ||
task :configure, :roles => :app, :except => { :no_release => true } do | ||
run "cp -f #{current_path}/config/deploy/#{stage}/apache/* /etc/apache2/sites-enabled/" | ||
end | ||
|
||
[:stop, :start, :restart].each do |action| | ||
desc "#{action.to_s.capitalize} Apache" | ||
task action, :roles => :web do | ||
run "sudo apache2ctl #{action.to_s}" | ||
end | ||
end | ||
end | ||
|
||
after 'apache:configure', 'apache:restart' | ||
end |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Define some defaults for capistrano deploys. | ||
# To load this capistrano configuraiton, require 'easy/deployment/niet' from deploy.rb | ||
|
||
Capistrano::Configuration.instance(:must_exist).load do | ||
namespace :niet do | ||
desc "Starts the niet process monitor" | ||
task :start, roles: :job do | ||
2.times do | ||
run "niet -c #{current_path} bundle exec rake jobs:work RAILS_ENV=#{stage}" | ||
end | ||
end | ||
|
||
desc "Restarts the niet process monitor" | ||
task :restart, roles: :job do | ||
run "killall -u deploy niet" | ||
end | ||
|
||
desc "Stops the niet process monitor" | ||
task :stop, roles: :job do | ||
run "killall -u deploy -QUIT niet" | ||
end | ||
|
||
desc "Diplays the status of the niet process monitor" | ||
task :status, roles: :job do | ||
run "ps -fu deploy" | ||
end | ||
end | ||
end |