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

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

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