Capistrano is an open source tool for running scripts on
multiple servers. Its main use is deploying web
applications including supporting tasks such as
changing databases.
3. What is Capistrano
●It is an open source tool for running scripts on
multiple servers; its main use is deploying web
applications including supporting tasks such as
changing databases.
●It is written in Ruby and distributed using
RubyGems
●Latest version 3.4.0, released March 2nd
2015
7. Deployment Flow
●Deploy Flow
deploy:starting - start a deployment, make sure everything
is ready
deploy:started - started hook (for custom tasks)
deploy:updating - update server(s) with a new release
deploy:updated - updated hook
deploy:publishing - publish the new release
deploy:published - published hook
deploy:finishing - finish the deployment, clean up everything
deploy:finished - finished hook
14. Advanced Features
●Host Filter
- HOSTS=server1,server2 cap production deploy
- In config/deploy.rb: set :filter, :host => %w{server1 server2}
- cap --hosts=server1,server2 production deploy
●Rule Filter
- ROLES=app,web cap production deploy
- In config/deploy.rb: set :filter, :roles => %w{app web}
- cap --roles=app,web production deploy
●Overriding Capistrano Tasks
- clear_prerequisites
- clear_actions
- clear_comments