Capistrano: A Tool For Simplified Deployment
Capistrano: A Tool For Simplified Deployment
What is deployment ?
Capistrano Introduction
The main functionality of the Capistrano is to deploy the application from a local machine to remote servers. Capistrano will transfer all the files of the application from local machine to remote server directly by simply executing an simple command in command prompt.
Capistrano Features
Deployment in a single command. Various other tasks can also be performed remote servers. Works for different stages. Hassle free code rollback in case of failure.
Installing Capistrano Capifying a project Configuring deployment scripts. Run Capistrano setup command Application is ready to be deployed.
Installing Capistrano
Capistrano is available as a gem and can be installed easily by typing the following command gem i capistrano Various tasks for capistrano can be found by typing
cap -T
Capifying a project
A rails application can be capified by running the following command under the rails project directory. capify . It will Creates two files:
config/deploy.rb - capfile
Configuring deploy.rb
set :application, yourappname" set :repository, your svn/git url" role :web, your site address" role :app, " your site address " role :db, " your site address " set :deploy_to, path to deploy" set :deploy_via, :remote_cache set :user, username" set :scm, :svn set :scm_username, svn username" set :scm_password, svn password set :use_sudo, :false desc description of the task" task :restart, :roles => :app do # Im not going to restart anything for this example end task :after_deploy, :roles => :app do # Tasks to be run after deployment end
Capistrano Rollback
cap rollback
cap disable_web
cap enable_web
Capistrano commands
Namespace tasks
Queries?
References
http://help.github.com/deploy-wth-capsitrano http://github.com/capistrano/capstrano/wiki
You
Thank