Capistrano - Deployment Tool

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Capistrano - Deployment Tool - Presentation Transcript

    1. Capistrano Deployment tool By Nagesh
    2. What is Capistrano?
      • Capistrano is an open source tool for running scripts on multiple servers;
    3. Intro to Capistrano
      • The main functionality of the Capistrano is to Deploy the rails application which you have already written. and we are using the "SVN" subversion to manage the code. Capistrano will transfer all the files of the rails application which you have developed in your local host to server directly by simply executing an simple command in your command prompt.
    4. Hosting servers?
    5. How Do I Install It? gem install capistrano
    6. Installing Capistrano
      • Cap –TV => Shows the all available options
      • Create a rails application and capistranize your application using the following command
        • capify .
      • It will Creates two files:
        • config/deploy.rb
        • - capfile
    7.  
    8. deploy.rb
      • set :application, “yourappname"
      • set :repository, “your svn url"
      • role :web, “your site address"
      • role :app, " your site address "
      • role :db, " your site address "
      • set :deploy_to, “path to deploy"
      • set :user, “username"
      • set :svn_username, “svn username"
      • set :svn_password, “svn password"
      • desc "Restart the webserver/fcgi procs, however you do it"
      • task :restart, :roles => :app do
      • # I’m not going to restart anything for this example
      • end
      • task :after_deploy, :roles => :app do
      • # Set my new dispatch.fcgi to be executable
      • run "chmod 755 #{deploy_to}/current/public/dispatch.fcgi"
      • end
      • Roles Named subsets of servers
      • Multiple applications on your host
    9. Need a Deploy Target? Run once to create the deploy directories
      • cap setup
      • it will create the directory structure in server
    10. First Time Deploy? Checks out the latest revision; makes it the current
      • cap update_code symlink
      • lighttpd -f /path/to/current/lighttpd.conf
    11. New Release Ready? Updates code on all servers; restarts FCGI processes
        • cap deploy
    12. Deployed a Lemon? Goes back to last revision; restarts FCGI processes
      • cap rollback
    13. Need Some Downtime? Disables web access; puts up maintenance page
      • cap disable_web
      • cap enable_web
    14. What’s the Current Revision? Tasks can access all configuration variables $ cap current_revision
    15. Chaining Tasks
      • $ cap status
    16. Multiple Configurations
      • $ cap -S where=production deploy
    17. Important commands
      • 1) cap deploy:setup This command creates the appropriate directory structure for Capistrano on the deployment server based upon values set in your deploy.rb 2) cap deploy:check If everything is successful, you should see a message that reads something like… You appear to have all necessary dependencies installed
      • 3) cap deploy:update push your code out to the server 4) cap deploy:start to start up your application
    18. Capistrano Just Assumes...
      • Same deploy directory structure and password on each machine
      • Web app uses FastCGI with Apache or LightTPD
      • As the number of machines and processes in your environment increases... you’re still typing exactly one command.
      • QUERIES?
    19. With Git?
      • default_run_options[:pty] = true
      • set :repository, "git@github.com:vanpelt/rails-app.git"
      • set :scm, "git"
      • set :scm_passphrase, "p@ssw0rd"
      • set :user, "deployer"
      • Thank You

    + Nyros TechnologiesNyros Technologies, 5 months ago

    custom

    531 views, 0 favs, 1 embeds more stats

    Seminar presentation on Capistrano by Nagesh at Nyr more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 531
      • 529 on SlideShare
      • 2 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 13
    Most viewed embeds
    • 2 views on http://www.developers-blog.com

    more

    All embeds
    • 2 views on http://www.developers-blog.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories