deploying and monitoring ruby on rails
play

Deploying and Monitoring Ruby on Rails A practical guide Mathias - PowerPoint PPT Presentation

Deploying and Monitoring Ruby on Rails A practical guide Mathias Meyer and Jonathan Weiss, 02.09.2008 Peritor GmbH Who are we? Jonathan W Jonathan Weiss eiss Consultant for Peritor GmbH in Berlin Specialized in Rails, Scaling,


  1. Capistrano Deployment Cycle 77

  2. Requirements 78

  3. What doesn’t Capistrano do? • Plan your initial server setup • Configure basic services 79

  4. Basic Ingredients • The cap command • Variables • Roles • Tasks • Namespaces 80

  5. Basic Ingredients - cap Your one-stop deployment shop 81

  6. Basic Ingredients - Variables • Configure basic project information • Override Capistrano’s default assumptions • Once set, variables are available globally • Defined using the set method 82

  7. Basic Ingredients - Roles • Define types of servers • Default roles • :www • :app • :db • All can point to the same server • But all three must be defined • At least one database server needs to be primary 83

  8. Basic Ingredients - Roles Define custom roles as you please Can be reused when defining tasks 84

  9. Basic Ingredients - Tasks • Define an atomic set of actions for Capistrano • Can be called from the command line • Or other tasks 85

  10. Basic Ingredients - Tasks To find all the tasks available in your project, use 86

  11. Basic Ingredients - Namespaces Group tasks together logically Namespaces and tasks are separated with “:” 87

  12. Get Your Capistrano On 88

  13. Get Your Capistrano On Capfile, the place to include more recipes 89

  14. Get Your Capistrano On config/deploy.rb, application specific configuration 90

  15. Capistrano’s Defaults • Your SCM is Subversion • Deployment directory is /u/apps/#{application_name} • User for SCM and SSH is the currently logged-in user • Commands are run with sudo 91

  16. Get Your Capistrano On 92

  17. Get Your Capistrano On • Capistrano expects a directory structure • Can be created with cap deploy:setup 93

  18. The Deployment Lifecycle 94

  19. The Deployment Lifecycle Check the prerequisites: 95

  20. The Deployment Lifecycle Set up your application for the first time 96

  21. The Deployment Lifecycle The initial deployment 1. Checks the revision from the local machine 2. Checks out the code on the remote machines 3. Sets a link called current pointing to the lates release 4. Runs the migrations 5. Fires up application servers 97

  22. The Deployment Lifecycle 98

  23. The Deployment Lifecycle Subsequent deployments 1. Checks the revision from the local machine 2. Checks out the code on the remote machines 3. Updates current link 4. Restarts application servers 99

  24. The Deployment Lifecycle 100

Recommend


More recommend