Ruby internal DSL (Domain Specific Language)
Automate System Administration Tasks
Run shell commands over SSH
Upload and Download small files (over SSH)
Application Deploy
Management Tasks
System Bootstraping
(Uncle Ben - Spiderman)
Check servers uptime
Check mail queues
Run a script as workaround to an incident
Install/Uninstall packages
ruby
ruby-dev
rubygems
# gem install capistrano
...
# capify
Please specify the directory to capify, e.g. `capify .'
$ mkdir hello_capistrano
$ capify hello_capistrano
[add] writing 'hello_capistrano/Capfile'
[add] making directory 'hello_capistrano/config'
[add] writing 'hello_capistrano/config/deploy.rb'
[done] capified!
hello_capistrano ----> Capfile
|
--> config ---> deploy.rb
hello_capistrano$ cap -T
cap deploy # Deploys your project.
cap deploy:check # Test deployment dependencies.
cap deploy:cleanup # Clean up old releases.
cap deploy:cold # Deploys and starts a `cold' application.
cap deploy:migrate # Run the migrate rake task.
cap deploy:migrations # Deploy and run pending migrations.
cap deploy:pending # Displays the commits since your last deploy.
cap deploy:pending:diff # Displays the `diff' since your last deploy.
cap deploy:restart # Restarts your application.
cap deploy:rollback # Rolls back to a previous version and restarts.
cap deploy:rollback:code # Rolls back to the previously deployed version.
cap deploy:setup # Prepares one or more servers for deployment.
cap deploy:start # Start the application servers.
cap deploy:stop # Stop the application servers.
cap deploy:symlink # Updates the symlink to the most recently deployed ...
cap deploy:update # Copies your project and updates the symlink.
cap deploy:update_code # Copies your project to the remote servers.
cap deploy:upload # Copy files to the currently deployed version.
cap deploy:web:disable # Present a maintenance page to visitors.
cap deploy:web:enable # Makes the application web-accessible again.
cap invoke # Invoke a single command on the remote servers.
cap shell # Begin an interactive Capistrano session.
Some tasks were not listed, either because they have no description,
or because they are only used internally by other tasks. To see all
tasks, type `cap -vT'.
Extended help may be available for these tasks.
Type `cap -e taskname' to view it.
send simultaneously one command to all servers
$ cap invoke COMMAND="echo 'Hello World'"
$ cap invoke COMMAND="echo 'Hello World'" SUDO=1
all connections that are established during the duration of the shell session are cached and reused
refactoring, debugging and integrating
(define functions and/or classes)
it’s a system automation tools
for full Configuration Management evaluate a complete solution as
Homepage:
http://www.capify.org/index.php/Capistrano
Capistrano Handbook:
http://github.com/leehambley/capistrano-handbook/blob/master/index.markdown
Getting Started:
http://www.capify.org/index.php/Getting_Started
Railsless Capistrano Extension:
http://github.com/leehambley/railsless-deploy/
Deploy Drupal with Capistrano: