• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Capistrano
 

Capistrano

on

  • 872 views

Presentation given to the April 2010 Ruby on Rails Meetup group.

Presentation given to the April 2010 Ruby on Rails Meetup group.

Statistics

Views

Total Views
872
Views on SlideShare
863
Embed Views
9

Actions

Likes
0
Downloads
5
Comments
0

2 Embeds 9

http://www.techgig.com 7
http://www.m.techgig.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Capistrano Capistrano Presentation Transcript

    • Capistrano
    • Prerequisites
      • SSH access to server
      • SSH user/password (ssh keys are better)
      • Ruby
        • Step 1: Cut a hole in the box
        • gem install capistrano
        • Step 2: cd path/to/project
        • Step 3: capify .
      Project Setup
    • Customize config.rb
      • Required settings
      set :application , "test_app" set :domain , "mysite.com" set :deploy_to , "/var/www/apps/#{application}" set :repository , " http://svn.centresource.com/#{application}/trunk " role :web , domain # where the web server runs role :app , domain # where the application layer runs role :db , domain, :primary => true # where your db runs
    • Customize config.rb
      • Optional settings
      set :scm , :git set :repository , " [email_address] :username/projectname.git" set :user , "deploy" set :password , "p@55w0rd" set :use_sudo , false
      • Recommended settings
      set :deploy_via , 'remote_cache' set :keep_releases , 5
    • Folder Structure
      • Folder structure on server (created by calling cap servers:setup )
      /deploy_to_path --current (symlink) --releases --20100422123598 --20100422123942 --shared --system --pids --logs
    • The Process
      • Container (does nothing)
      • Container (does nothing)
      • Copies code to server
      • Touches up the copied code
      • Updates current symlink
      • Restarts application
    • Custom Tasks # symlink database namespace :deploy do desc "Symlink database." task :symlink_db do run "ln -nfs #{shared_path}/system/database.yml #{release_path}/config/database.yml" end end after 'deploy:update_code' , 'deploy:symlink_db'
    • Overwrite Tasks namespace :deploy do # symfony doesn't need these tasks task :start do ; end task :stop do ; end task :restart do ; end # doctrine migration task :migrate do run "cd #{release_path} && php symfony doctrine:migrate --env='prod'" end end
    • Put It All Together
      • cap servers:setup
      • cap deploy:cold
      • cap deploy
      • cap deploy:migrations
      • cap deploy:rollback
      • cap -T
    • Questions?