0% found this document useful (0 votes)
25 views19 pages

Capistrano: A Tool For Simplified Deployment

Capistrano is a tool that simplifies application deployment. It allows developers to deploy applications from their local machine to remote servers with a single command. Capistrano transfers files, configures servers, and performs other deployment tasks. It supports rollback if deployment fails and can deploy to different environments. Developers install Capistrano as a gem, configure deployment scripts, and then deploy with a single command.

Uploaded by

piyush25
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views19 pages

Capistrano: A Tool For Simplified Deployment

Capistrano is a tool that simplifies application deployment. It allows developers to deploy applications from their local machine to remote servers with a single command. Capistrano transfers files, configures servers, and performs other deployment tasks. It supports rollback if deployment fails and can deploy to different environments. Developers install Capistrano as a gem, configure deployment scripts, and then deploy with a single command.

Uploaded by

piyush25
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

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.

How Capistrano Works ?

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

Setting up deploy target


cap setup => It will create the directory structure in server.

First time deployment


cap update_code symlink => It checks out the latest version, and marks it as current.

Deploying with Capistrano


cap deploy

Capistrano Rollback
cap rollback

Need Some Downtime?

cap disable_web

cap enable_web

Capistrano commands

Namespace tasks

Some useful variables

Queries?

References

http://help.github.com/deploy-wth-capsitrano http://github.com/capistrano/capstrano/wiki

You

Thank

You might also like