mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Make default tasks work only on app/db/web roles, so that additional roles may be created for boxes with specific needs without needing to (for instance) deploy the app to those boxes
git-svn-id: http://svn.rubyonrails.org/rails/tools/switchtower@2132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
fb5144ca96
commit
24640dd9a8
2 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,7 @@
|
||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* Make default tasks work only on app/db/web roles, so that additional roles may be created for boxes with specific needs without needing to (for instance) deploy the app to those boxes
|
||||||
|
|
||||||
* Default the application name to "Application" when using --apply-to
|
* Default the application name to "Application" when using --apply-to
|
||||||
|
|
||||||
* Show the help screen instead of an error when no arguments are given
|
* Show the help screen instead of an error when no arguments are given
|
||||||
|
|
|
@ -24,7 +24,7 @@ task :show_tasks do
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Set up the expected application directory structure on all boxes"
|
desc "Set up the expected application directory structure on all boxes"
|
||||||
task :setup do
|
task :setup, :roles => [:app, :db, :web] do
|
||||||
run <<-CMD
|
run <<-CMD
|
||||||
mkdir -p -m 775 #{releases_path} #{shared_path}/system &&
|
mkdir -p -m 775 #{releases_path} #{shared_path}/system &&
|
||||||
mkdir -p -m 777 #{shared_path}/log
|
mkdir -p -m 777 #{shared_path}/log
|
||||||
|
@ -53,7 +53,7 @@ desc <<DESC
|
||||||
Update all servers with the latest release of the source code. All this does
|
Update all servers with the latest release of the source code. All this does
|
||||||
is do a checkout (as defined by the selected scm module).
|
is do a checkout (as defined by the selected scm module).
|
||||||
DESC
|
DESC
|
||||||
task :update_code do
|
task :update_code, :roles => [:app, :db, :web] do
|
||||||
on_rollback { delete release_path, :recursive => true }
|
on_rollback { delete release_path, :recursive => true }
|
||||||
|
|
||||||
source.checkout(self)
|
source.checkout(self)
|
||||||
|
@ -69,7 +69,7 @@ desc <<DESC
|
||||||
Rollback the latest checked-out version to the previous one by fixing the
|
Rollback the latest checked-out version to the previous one by fixing the
|
||||||
symlinks and deleting the current release from all servers.
|
symlinks and deleting the current release from all servers.
|
||||||
DESC
|
DESC
|
||||||
task :rollback_code do
|
task :rollback_code, :roles => [:app, :db, :web] do
|
||||||
if releases.length < 2
|
if releases.length < 2
|
||||||
raise "could not rollback the code because there is no prior release"
|
raise "could not rollback the code because there is no prior release"
|
||||||
else
|
else
|
||||||
|
@ -84,7 +84,7 @@ desc <<DESC
|
||||||
Update the 'current' symlink to point to the latest version of
|
Update the 'current' symlink to point to the latest version of
|
||||||
the application's code.
|
the application's code.
|
||||||
DESC
|
DESC
|
||||||
task :symlink do
|
task :symlink, :roles => [:app, :db, :web] do
|
||||||
on_rollback { run "ln -nfs #{previous_release} #{current_path}" }
|
on_rollback { run "ln -nfs #{previous_release} #{current_path}" }
|
||||||
run "ln -nfs #{current_release} #{current_path}"
|
run "ln -nfs #{current_release} #{current_path}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue