Your SlideShare is downloading. ×
0
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
Capistrano
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

Capistrano

1,098

Published on

A presentation on Capistrano I delivered at the Tshwane University of Technology some time ago.

A presentation on Capistrano I delivered at the Tshwane University of Technology some time ago.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,098
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
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. Capistrano Everywhere A brief overview of the possibilities Kenneth Kalmer www.opensourcery.co.za
  • 2. Capistrano is Great for deploying any application, not just ● Rails Great for probing multiple servers quickly ● Automating long tasks ● Good for your health ● On the fly maintenance ● Much much more... ●
  • 3. Problems with FTP Nice progress bars ● Uploading a local copy, not a clean revision ● from VCS Why FTP the same code to more than one ● server? How do you rollback a vanilla FTP upload? ● What if your connection timeouts in the middle ● of the upload? Everyone does it differently! ●
  • 4. Successful Deployment Recipes Well defined process with consistent results ● Error handling and rollbacks ● Clear role definition (even on one server) ● Complimentary tasks ● Separation between application and user ● generated data (uploads, etc...) Leverage complimentary technologies (rake) ● Individual users deploy same project ●
  • 5. Rails Highlights Plugins can extend deployment recipes ● Easy multi stage deployments ● Remote console access ● Remote dependencies ● Rubygems – Commands – Run tests on deployment ●
  • 6. But I use PHP! Conceptually the same ● Update the DocumentRoot to serve out of the ● “current” symlink Update Options to have FollowSymlinks ● Add blank “deploy:restart”, “deploy:start” and ● “deploy:stop” tasks to Capfile Get a host that will give you shell access ● You gain better structure and discipline! ● Switch to Ruby ●
  • 7. Custom Deployment Recipes “deploy” namespace provided by deploy.rb ● Can write custom deployment steps as long as: ● Process is well defined and repeatable – Process is well defined and repeatable – Errors are handled – Deploy Xen management scripts across several ● hosts Update backup scripts across several hosts ● Deploy SSH keys across several hosts ●
  • 8. Complimentary Deployment Tasks Using rake to ● Download copies of the production database – Download copies of the production logs – Minify assets – Update external dependencies (local copy of ● Google Analytics JavaScript) Disable monit during deployment ●
  • 9. System Administration Inspect the health of mail queues ● $ cap mail:queues   * executing `mail:queues'   * executing quot;postqueue ­p | tail ­n 1quot;     servers: [quot;192.168.2.15quot;, quot;192.168.2.16quot;, quot;192.168.2.17quot;, quot;192.168.2.18quot;,  quot;192.168.2.14quot;] # ADDITIONAL OUTPUT REMOVED Mail queues on servers at 2008­05­29 00:38:10 192.168.2.15 ­­ 4354 Kbytes in 44 Requests. 192.168.2.16 ­­ 4635 Kbytes in 72 Requests. 192.168.2.14 ­­ 0 Kbytes in 1 Request. 192.168.2.17 ­­ 9079 Kbytes in 24 Requests. 192.168.2.18 ­­ 13168 Kbytes in 1 Request.
  • 10. More for administrators Check uptime ● Check memory usage ● Check disk usage ● Search log files ● Leverage sudo ● On the fly audits ● Restart services ●
  • 11. Things to remember It's a Linux server on the other side, think of ● Capistrano as an automated putty session to multiple hosts It is written in Ruby, so it can be bent to your will ● Default deployment recipes are not cast in ● stone, they just follow good principles It's not just for deployments, deployments was ● the birth of Capistrano
  • 12. Q&A
  • 13. Thank You www.opensourcery.co.za

×