Your SlideShare is downloading. ×
Deploying Rails Applications with Capistrano
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Deploying Rails Applications with Capistrano

1,497
views

Published on

Published in: Technology, Business

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,497
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Deploying Rails applications with Capistrano http://www.flickr.com/photos/jsome1/2226394415
  • 2. What is Capistrano? http://www.flickr.com/photos/dionisio/2481071707
  • 3. requirementsRuby + Rake SCM SSH
  • 4. installation$ gem install capistrano
  • 5. assumptions● We are using SSH. Telnet and FTP are not supported● Servers have POSIX-compatible shell● SSH Keys configured
  • 6. capification$ cd my_app$ cap ./my_app| - Capifile| - /config/deploy.rb
  • 7. 1/2 configurationset :application, “siege”set :repository, “git@github.com:m3nd3s/siege.git”set :scm, :gitset :branch, “master”set :ssh_options, { :forward_agent => true }set :user, “giran”set :deploy_to, “/home/giran/siege”set :my_var, “Giran Siege” config/deploy.rb
  • 8. 2/2 configurationrole :web, “siege.giran.com.br”role :app, “siege.giran.com.br”role :db, “siege.giran.com.br”
  • 9. taskstask :acceptance do set :user, "root" set :deploy_to, "/var/www/siege"end
  • 10. setting up$ cap deploy:setup# Or cascaded tasks$ cap acceptance deploy:setup
  • 11. structure[deploy_to][deploy_to]/releases[deploy_to]/shared[deploy_to]/shared/log[deploy_to]/shared/pids[deploy_to]/shared/system
  • 12. database ● Database needs to be creatednamespace :deploy do task :database, :roles => :app do run "cp #{deploy_to}/shared/database.yml#{current_path}/config/" endend
  • 13. deploy$ cap deploy# Or cascaded tasks$ cap acceptance deploy
  • 14. after and beforeafter :deploy, deploy:databasenamespace :deploy do ...end
  • 15. restartnamespace :deploy do task :restart, :roles => :app, :except => {:no_release => true } do run "cd #{current_path} && touch tmp/restart.txt" endend
  • 16. http://www.flickr.com/photos/mpawl/1572150843
  • 17. referenceshttps://github.com/capistrano/capistrano/wiki/_pages
  • 18. thank you ! Almir m3nd3s @m3nd3shttp://www.almirmendes.com almir.mendes@giran.com.br m3nd3s@gmail.com http://www.flickr.com/photos/meepfriends/2279161806