SlideShare a Scribd company logo
1 of 18
Download to read offline
Getting Started with Capistrano
       in Ten Easy Steps



            Keith Pitty

         http://keithpitty.org
         keith@keithpitty.org
What is Capistrano?

   ●   A tool that aims to make it easy to deploy Rails
       applications!
   ●   Written by Jamis Buck, one of the core Rails team




21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   2
These ten steps are based on my
  experience
   ●   Starting point:
        –     “Agile Web Development with Rails”
        –     2nd edition, Section 27.5
   ●   There may be better ways, but...
   ●   The following steps worked for me




21 Feb 2007       Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   3
Step 1: Install Software

   ●   Client and server
        –     my client: OS X
        –     my server: Fedora Core 6 on a VPS
   ●   Native components
        –     apache2, mysql5, ruby, rb-rubygems, rb-termios
   ●   Ruby gems
        –     rake, rails, termios, capistrano, mongrel,
              mongrel_cluster

   $ sudo gem install --include-dependencies [gem]


21 Feb 2007       Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   4
Step 2: Set up Database

   mysql> create database app;

   mysql > grant all privileges on app.* to
     'app'@'localhost identified by 'password'
     with grant option;




21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   5
Step 3: Add Mongrel to Project

   ●   On development machine, this will create
       config/mongrel_cluster.yml:



    $ mongrel_rails cluster::configure
      -e production -p 8000 -a 127.0.0.1 -N -2
      /deploy/path/current




21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   6
Step 4: Apply Capistrano to Project

   ●   On development machine, this will create
       config/deploy.rb and
       lib/tasks/capistrano.rake:

    $ cap –apply-to /local/project/path [app]




21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   7
Step 5: Configure Capistrano (1)

   ●   Edit config/deploy.rb:
        –     Add as first statement:



    require 'mongrel_cluster/recipes'




21 Feb 2007       Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   8
Step 5: Configure Capistrano (2)

   ●   Edit config/deploy.rb:
        –     Set variables:

    set :application, “app”
    set :repository,
      “http:svn.host.com/#{application}/trunk”
    set :deploy_to,
      “/usr/local/railsapps/#{application}”
    set :mongrel_conf,
      “#{current_path}/config/mongrel_cluster.yml”


21 Feb 2007       Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   9
Step 5: Configure Capistrano (3)

   ●   Edit config/deploy.rb (continued):


    set       :web, “my.host.com”
    set       :app, “my.host.com”
    set       :db, “my.host.com”, :primary => true
    set       :user, “keith”




21 Feb 2007      Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   10
Step 6: Set up Directories

   ●   On development machine, this will set up
       directories on target server:


              $ cap setup




21 Feb 2007      Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   11
Step 7: Secure Database

   ●   Copy database.yml to
       #{shared_path}/config on server
   ●   Rename to database.yml.production and set
       production username and password
   ●   Add the following to :after_update_code task
       in config/deploy.rb:
 db_config =
   “#{shared_path}/config/database.yml.production”
 run “cp #{db_config}
   #{release_path}/config/database.yml”
21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   12
Step 8: Ensure Subversion is OK

   ●   Installed on client and server?
   ●   Repository created on server?
   ●   Apache configured for subversion?
   ●   svn import?
   ●   svn checkout?




21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   13
Step 9: Deploy and Verify

   ●   One more pre-req: edit sudoers file on server
   ●   Deploy app, create tables (from client):

       $ cap cold_deploy
       $ cap migrate

   ●   Verify (on server):

       $ curl -I http://127.0.0.1:8000


21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   14
Step 10: Configure Apache

   ●   Configure Apache to connect to Mongrel
        –     Proxy for mongrel_cluster
        –     VirtualHost with rewrite rules for app
        –     see AWDwR, Section 27.5, Step Five for details
   ●   Restart Apache
   ●   App should now work via browser!




21 Feb 2007       Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   15
From now on it will be easy!

   ●   When you've checked in some changes:

       $ cap deploy



   ●   If you need to back out your changes:

       $ cap rollback



21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   16
Resources

   ●   “Agile Web Development with Rails”
        –     Second Edition, section 27.5
   ●   http://manuals.rubyonrails.com/read/book/17
        –     when it's available
   ●   http://rubyforge.org/projects/capistrano/
   ●   http://weblog.jamisbuck.org
   ●   capistrano@googlegroups.com
   ●   rubyonrails-deployment@googlegroups.com



21 Feb 2007       Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   17
Thanks for listening!



                                 Keith Pitty

                           http://keithpitty.org
                           keith@keithpitty.org




21 Feb 2007   Sydney RoR Meetup: quot;Getting Started with Capistranoquot;   Keith Pitty   18

More Related Content

What's hot

MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on DockerDaniel Ku
 
"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola BorozdinFwdays
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Derek Willian Stavis
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubDocker, Inc.
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про HerokuSerge Seletskyy
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Alvaro Sanchez-Mariscal
 
Google App Engine with JSF 2.x
Google App Engine with JSF 2.xGoogle App Engine with JSF 2.x
Google App Engine with JSF 2.xPatrick Nascimento
 
Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Love Nyberg
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use ItDaniel Kummer
 
JS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesJS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesNick Dreckshage
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet
 
KubeCon 2017 Zero Touch Provision
KubeCon 2017 Zero Touch ProvisionKubeCon 2017 Zero Touch Provision
KubeCon 2017 Zero Touch ProvisionRackN
 
Heroku 101 py con 2015 - David Gouldin
Heroku 101   py con 2015 - David GouldinHeroku 101   py con 2015 - David Gouldin
Heroku 101 py con 2015 - David GouldinHeroku
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the webLarry Nung
 
Geb quick start
Geb quick startGeb quick start
Geb quick startSukjin Yun
 
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」Tsuyoshi Yamamoto
 

What's hot (19)

MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
Front-end tools
Front-end toolsFront-end tools
Front-end tools
 
"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
 
Google App Engine with JSF 2.x
Google App Engine with JSF 2.xGoogle App Engine with JSF 2.x
Google App Engine with JSF 2.x
 
Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
JS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & RoutesJS Chicago Meetup 2/23/16 - Redux & Routes
JS Chicago Meetup 2/23/16 - Redux & Routes
 
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate) Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
 
KubeCon 2017 Zero Touch Provision
KubeCon 2017 Zero Touch ProvisionKubeCon 2017 Zero Touch Provision
KubeCon 2017 Zero Touch Provision
 
Heroku 101 py con 2015 - David Gouldin
Heroku 101   py con 2015 - David GouldinHeroku 101   py con 2015 - David Gouldin
Heroku 101 py con 2015 - David Gouldin
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
Geb quick start
Geb quick startGeb quick start
Geb quick start
 
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
第1回名古屋Grails/Groogy勉強会「Grailsを始めてみよう!」
 
Learnings from govuk
Learnings from govukLearnings from govuk
Learnings from govuk
 

Viewers also liked

Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with CapistranoLaunchAny
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and ChefDavid Benjamin
 
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do ItChef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do ItRightScale
 

Viewers also liked (6)

Capistrano
CapistranoCapistrano
Capistrano
 
Capistrano
CapistranoCapistrano
Capistrano
 
Photos
PhotosPhotos
Photos
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do ItChef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
Chef vs. Puppet in the Cloud: How Telepictures and MoneySuperMarket Do It
 

Similar to Getting Started with Capistrano in Ten Easy Steps

The Big Cloud native FaaS Lebowski
The Big Cloud native FaaS LebowskiThe Big Cloud native FaaS Lebowski
The Big Cloud native FaaS LebowskiQAware GmbH
 
You got database in my cloud (short version)
You got database  in my cloud (short version)You got database  in my cloud (short version)
You got database in my cloud (short version)Liz Frost
 
[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017Oracle Korea
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceBen Hall
 
Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6LetsConnect
 
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & GraphingAn Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & GraphingAbhishek Kumar
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesBertrand Delacretaz
 
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdfHow to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdfgerardov5
 
Bdc from bare metal to k8s
Bdc   from bare metal to k8sBdc   from bare metal to k8s
Bdc from bare metal to k8sChris Adkin
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic OperationSimon Su
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby DevelopersAptible
 
The Big Cloud Native FaaS Lebowski
The Big Cloud Native FaaS LebowskiThe Big Cloud Native FaaS Lebowski
The Big Cloud Native FaaS LebowskiQAware GmbH
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen Hall
 
Using rbenv in Production
Using rbenv in ProductionUsing rbenv in Production
Using rbenv in ProductionNic Benders
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - WebinarAlkin Tezuysal
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про HerokuGeeksLab Odessa
 
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...CloudOps2005
 

Similar to Getting Started with Capistrano in Ten Easy Steps (20)

The Big Cloud native FaaS Lebowski
The Big Cloud native FaaS LebowskiThe Big Cloud native FaaS Lebowski
The Big Cloud native FaaS Lebowski
 
You got database in my cloud (short version)
You got database  in my cloud (short version)You got database  in my cloud (short version)
You got database in my cloud (short version)
 
[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017[Hands-on] Kubernetes | Nov 18, 2017
[Hands-on] Kubernetes | Nov 18, 2017
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6Installing Component Pack 6.0.0.6
Installing Component Pack 6.0.0.6
 
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & GraphingAn Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
An Express Guide ~ Cacti for IT Infrastructure Monitoring & Graphing
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètes
 
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdfHow to publish ASP.NET Core web application via Visual Studio 2019.pdf
How to publish ASP.NET Core web application via Visual Studio 2019.pdf
 
Bdc from bare metal to k8s
Bdc   from bare metal to k8sBdc   from bare metal to k8s
Bdc from bare metal to k8s
 
Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
The Big Cloud Native FaaS Lebowski
The Big Cloud Native FaaS LebowskiThe Big Cloud Native FaaS Lebowski
The Big Cloud Native FaaS Lebowski
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Using rbenv in Production
Using rbenv in ProductionUsing rbenv in Production
Using rbenv in Production
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Introduction to Vitess on Kubernetes for MySQL - Webinar
Introduction to Vitess on Kubernetes for MySQL -  WebinarIntroduction to Vitess on Kubernetes for MySQL -  Webinar
Introduction to Vitess on Kubernetes for MySQL - Webinar
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
 
Pragmatic sbt
Pragmatic sbtPragmatic sbt
Pragmatic sbt
 
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
 

More from elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

More from elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Getting Started with Capistrano in Ten Easy Steps

  • 1. Getting Started with Capistrano in Ten Easy Steps Keith Pitty http://keithpitty.org keith@keithpitty.org
  • 2. What is Capistrano? ● A tool that aims to make it easy to deploy Rails applications! ● Written by Jamis Buck, one of the core Rails team 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 2
  • 3. These ten steps are based on my experience ● Starting point: – “Agile Web Development with Rails” – 2nd edition, Section 27.5 ● There may be better ways, but... ● The following steps worked for me 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 3
  • 4. Step 1: Install Software ● Client and server – my client: OS X – my server: Fedora Core 6 on a VPS ● Native components – apache2, mysql5, ruby, rb-rubygems, rb-termios ● Ruby gems – rake, rails, termios, capistrano, mongrel, mongrel_cluster $ sudo gem install --include-dependencies [gem] 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 4
  • 5. Step 2: Set up Database mysql> create database app; mysql > grant all privileges on app.* to 'app'@'localhost identified by 'password' with grant option; 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 5
  • 6. Step 3: Add Mongrel to Project ● On development machine, this will create config/mongrel_cluster.yml: $ mongrel_rails cluster::configure -e production -p 8000 -a 127.0.0.1 -N -2 /deploy/path/current 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 6
  • 7. Step 4: Apply Capistrano to Project ● On development machine, this will create config/deploy.rb and lib/tasks/capistrano.rake: $ cap –apply-to /local/project/path [app] 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 7
  • 8. Step 5: Configure Capistrano (1) ● Edit config/deploy.rb: – Add as first statement: require 'mongrel_cluster/recipes' 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 8
  • 9. Step 5: Configure Capistrano (2) ● Edit config/deploy.rb: – Set variables: set :application, “app” set :repository, “http:svn.host.com/#{application}/trunk” set :deploy_to, “/usr/local/railsapps/#{application}” set :mongrel_conf, “#{current_path}/config/mongrel_cluster.yml” 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 9
  • 10. Step 5: Configure Capistrano (3) ● Edit config/deploy.rb (continued): set :web, “my.host.com” set :app, “my.host.com” set :db, “my.host.com”, :primary => true set :user, “keith” 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 10
  • 11. Step 6: Set up Directories ● On development machine, this will set up directories on target server: $ cap setup 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 11
  • 12. Step 7: Secure Database ● Copy database.yml to #{shared_path}/config on server ● Rename to database.yml.production and set production username and password ● Add the following to :after_update_code task in config/deploy.rb: db_config = “#{shared_path}/config/database.yml.production” run “cp #{db_config} #{release_path}/config/database.yml” 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 12
  • 13. Step 8: Ensure Subversion is OK ● Installed on client and server? ● Repository created on server? ● Apache configured for subversion? ● svn import? ● svn checkout? 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 13
  • 14. Step 9: Deploy and Verify ● One more pre-req: edit sudoers file on server ● Deploy app, create tables (from client): $ cap cold_deploy $ cap migrate ● Verify (on server): $ curl -I http://127.0.0.1:8000 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 14
  • 15. Step 10: Configure Apache ● Configure Apache to connect to Mongrel – Proxy for mongrel_cluster – VirtualHost with rewrite rules for app – see AWDwR, Section 27.5, Step Five for details ● Restart Apache ● App should now work via browser! 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 15
  • 16. From now on it will be easy! ● When you've checked in some changes: $ cap deploy ● If you need to back out your changes: $ cap rollback 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 16
  • 17. Resources ● “Agile Web Development with Rails” – Second Edition, section 27.5 ● http://manuals.rubyonrails.com/read/book/17 – when it's available ● http://rubyforge.org/projects/capistrano/ ● http://weblog.jamisbuck.org ● capistrano@googlegroups.com ● rubyonrails-deployment@googlegroups.com 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 17
  • 18. Thanks for listening! Keith Pitty http://keithpitty.org keith@keithpitty.org 21 Feb 2007 Sydney RoR Meetup: quot;Getting Started with Capistranoquot; Keith Pitty 18