SlideShare a Scribd company logo
1 of 26
Download to read offline
CAPISTRANO
 for non-Rubyists
who we are


   Dimitris Tsironis
    Founder at Geembo, UI designer & huge geek, who
    loves good design and french fries, as much as good
    indentation in a stylesheet. Follow him @tsironakos
    and @geemboHQ

   Dr. John Pagonis
    Dr. John Pagonis is onto something with Missum
    these days. You can follow him at @JohnPagonis
    and @MissumApp
WHAT’S THE PROBLEM?



       deploys can be a real mess

       mistakes could happen very easily
       you don’t mess with the production
       you’re actually delaying bug fixes, new features etc.
one-click deploys!
     (well, almost)
is a language agnostic tool for remote application
administration tasks
provisioning of infrastructure better handled
with other tools, eg. Chef, Puppet, Babushka
it fits well with deploying web-apps
heavily used by Rails community
it’s for sysadmins and devops guys
how it works
 under the bonnet
philosophy



       it runs on your computer

       connects to the server over ssh

       there is no Capistrano server or sth like that

       automates the tasks you would manually do
       with command-line
philosophy part ii



       uses a Ruby-based DSL for task automation

       there are already ready-to-use tasks
       cap shell offers an interactive prompt for adhoc
       commands
       cap shell sessions are cached and can be reused
built-in tasks


   It ships with plenty of stuff, by default
ready-to-use recipes

                  You can find plenty on Github
              https://github.com/nesquena/cap-recipes


           Ruby setup & RubyGems management

           Apache & Phusion Passenger
           Aptitude management
           MongoDB
           and much more!
custom tasks


  Tailor-made Capistrano tasks are easy.

  It’s all Ruby and Rake-like tasks, after all.
how to set it up
 prepare for the battle
set it up



            you need a Capfile in the root of the project

            then, you can execute capistrano tasks anywhere in
            your project’s folder, by running:

                        cap <task name>
rails-less deploy example
capify




         Capify is a file generator for your project

         usually used with Rails project but it works with other projects

         in general, it can be enhanced to work with other structures
capify

 One command to generate the files




 Files you need
         Capfile - basic Capistrano file in root of the project

         config/deploy.rb - here’s where you write custom tasks
production or staging


    config/deploy/production.rb




    config/deploy/staging.rb
roles



        allow you to write capistrano tasks that only apply to
        certain servers

        then you can do something like this
configuration example


    config/deploy.rb
custom tasks example

  config/deploy.rb
RAILS-specific magic
 tasks for Ruby on Rails only
asset precompile




                              PROBLEM
                   Asset precompile can be slow.

                   It could take several minutes that
                     we could use to make a coffee
                        or watch some cats gifs
asset precompile




                            solution

              Skip precompile, if it isn’t necessary

                     “The ability to destroy
                    a planet is insignificant
                    next to the power of Git”

                    --a tech-savvy Darth Vader
rails-specific magic

   config/deploy.rb




Source: StackOverflow of course!
RESOURCES


       Deploying with Capistrano - Github Help
       https://help.github.com/articles/deploying-with-capistrano

       Capistrano Wiki
       https://github.com/capistrano/capistrano/wiki

       Capistrano Multistage extension
       https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension

       Capistrano Handbook - still immature
       https://github.com/leehambley/capistrano-handbook/blob/master/
       index.markdown

       Capistrano Google Group
       http://groups.google.com/group/capistrano
thank you!
@JohnPagonis
 @tsironakos
@geemboHQ

More Related Content

What's hot

What's hot (20)

Frontend asset management with Bower and Gulp.js
Frontend asset management with Bower and Gulp.jsFrontend asset management with Bower and Gulp.js
Frontend asset management with Bower and Gulp.js
 
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo MeetupWordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
WordPress on the Jamstack by rtCamper Muhammad Muhsin @ WordPress Colombo Meetup
 
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
JHipster Conf 2018 : Connect your JHipster apps to the world of APIs with Ope...
 
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
OSCamp 2019 | #3 Ansible: Automated Tests of Ansible code with GitLab, Vagran...
 
Intro to Front End Development with Angular + Firebase
Intro to Front End Development with Angular + FirebaseIntro to Front End Development with Angular + Firebase
Intro to Front End Development with Angular + Firebase
 
2016 05-cloudsoft-amp-and-brooklyn-new
2016 05-cloudsoft-amp-and-brooklyn-new2016 05-cloudsoft-amp-and-brooklyn-new
2016 05-cloudsoft-amp-and-brooklyn-new
 
Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.Pulumi. Modern Infrastructure as Code.
Pulumi. Modern Infrastructure as Code.
 
Docker, developers take power
Docker, developers take powerDocker, developers take power
Docker, developers take power
 
Continuous deployment of Rails apps on AWS OpsWorks
Continuous deployment of Rails apps on AWS OpsWorksContinuous deployment of Rails apps on AWS OpsWorks
Continuous deployment of Rails apps on AWS OpsWorks
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Gulp - the streaming build system
Gulp - the streaming build systemGulp - the streaming build system
Gulp - the streaming build system
 
Why Puppet Sucks - Rob Terhaar
Why Puppet Sucks - Rob TerhaarWhy Puppet Sucks - Rob Terhaar
Why Puppet Sucks - Rob Terhaar
 
Serverless preview environments to the rescue
Serverless preview environments to the rescueServerless preview environments to the rescue
Serverless preview environments to the rescue
 
Docker orchestration with kontena
Docker orchestration with kontenaDocker orchestration with kontena
Docker orchestration with kontena
 
External ng2 lib
External ng2 libExternal ng2 lib
External ng2 lib
 
Mete Atamel - Serverless with Knative - Codemotion Amsterdam 2019
Mete Atamel - Serverless with Knative - Codemotion Amsterdam 2019Mete Atamel - Serverless with Knative - Codemotion Amsterdam 2019
Mete Atamel - Serverless with Knative - Codemotion Amsterdam 2019
 
Simulation in R and Python
Simulation in R and PythonSimulation in R and Python
Simulation in R and Python
 
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
Infrastructure-as-Code with Pulumi- Better than all the others (like Ansible)?Infrastructure-as-Code with Pulumi- Better than all the others (like Ansible)?
Infrastructure-as-Code with Pulumi - Better than all the others (like Ansible)?
 
Automate All the Things with Grunt
Automate All the Things with GruntAutomate All the Things with Grunt
Automate All the Things with Grunt
 
Render-as-You-Fetch
Render-as-You-FetchRender-as-You-Fetch
Render-as-You-Fetch
 

Viewers also liked

Jj new batch
Jj new batchJj new batch
Jj new batch
JJ Mentor
 
3 bedrooms + study
3 bedrooms + study3 bedrooms + study
3 bedrooms + study
Henry Loh
 
Semi d @ roseburn
Semi d @ roseburnSemi d @ roseburn
Semi d @ roseburn
Henry Loh
 
Nipah photos and floor plan
Nipah photos and floor planNipah photos and floor plan
Nipah photos and floor plan
Henry Loh
 

Viewers also liked (20)

Proyecto
ProyectoProyecto
Proyecto
 
Visiones sobre el aprendizaje
Visiones sobre el aprendizajeVisiones sobre el aprendizaje
Visiones sobre el aprendizaje
 
lionel messi
lionel messilionel messi
lionel messi
 
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آنامکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
امکان‌سنجی طراحی و ساخت سخت‌افزار شبیه‌ساز کنترل فوران چاه و نوشتن نرم افزار آن
 
Xii promoción
Xii promociónXii promoción
Xii promoción
 
Sandra liliana actividad1_2mapac.pdf
Sandra liliana actividad1_2mapac.pdfSandra liliana actividad1_2mapac.pdf
Sandra liliana actividad1_2mapac.pdf
 
Ferreira et al, abc (1995)
Ferreira et al, abc (1995)Ferreira et al, abc (1995)
Ferreira et al, abc (1995)
 
Proyecto decimo once
Proyecto decimo   onceProyecto decimo   once
Proyecto decimo once
 
Pequena borboleta slid
Pequena borboleta slidPequena borboleta slid
Pequena borboleta slid
 
Jj new batch
Jj new batchJj new batch
Jj new batch
 
Webquest
WebquestWebquest
Webquest
 
3 bedrooms + study
3 bedrooms + study3 bedrooms + study
3 bedrooms + study
 
Fall 2012, Class 02
Fall 2012, Class 02Fall 2012, Class 02
Fall 2012, Class 02
 
Posando para la foto
Posando para la fotoPosando para la foto
Posando para la foto
 
Semi d @ roseburn
Semi d @ roseburnSemi d @ roseburn
Semi d @ roseburn
 
Jewella at Disrupt Sydney September 2015
Jewella at Disrupt Sydney September 2015Jewella at Disrupt Sydney September 2015
Jewella at Disrupt Sydney September 2015
 
Nipah photos and floor plan
Nipah photos and floor planNipah photos and floor plan
Nipah photos and floor plan
 
Подводные камни финансовых стартапов
Подводные камни финансовых стартаповПодводные камни финансовых стартапов
Подводные камни финансовых стартапов
 
13 Things I Learnt (or Relearnt) in 2013
13 Things I Learnt (or Relearnt) in 201313 Things I Learnt (or Relearnt) in 2013
13 Things I Learnt (or Relearnt) in 2013
 
Advertising
AdvertisingAdvertising
Advertising
 

Similar to Capistrano for non-rubyist

Deploy made easy (even on Friday)
Deploy made easy (even on Friday)Deploy made easy (even on Friday)
Deploy made easy (even on Friday)
Riccardo Bini
 

Similar to Capistrano for non-rubyist (20)

DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
 
Deploy like a pro!
Deploy like a pro!Deploy like a pro!
Deploy like a pro!
 
Sparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With SparkSparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With Spark
 
Deploy made easy (even on Friday)
Deploy made easy (even on Friday)Deploy made easy (even on Friday)
Deploy made easy (even on Friday)
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small Teams
 
Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.io
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
Building Drupal 8 Sites
Building Drupal 8 SitesBuilding Drupal 8 Sites
Building Drupal 8 Sites
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Deployment Via Capistrano
Deployment Via CapistranoDeployment Via Capistrano
Deployment Via Capistrano
 
CAPISTRANO
CAPISTRANOCAPISTRANO
CAPISTRANO
 
CoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: A beginner's presentation for beginners copyCoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: A beginner's presentation for beginners copy
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
Anton Faibyshev - Drupal 8: lazy builder. What we need to build a house - we ...
Anton Faibyshev - Drupal 8: lazy builder. What we need to build a house - we ...Anton Faibyshev - Drupal 8: lazy builder. What we need to build a house - we ...
Anton Faibyshev - Drupal 8: lazy builder. What we need to build a house - we ...
 
DevOps For Small Teams
DevOps For Small TeamsDevOps For Small Teams
DevOps For Small Teams
 
Function as a Service
Function as a ServiceFunction as a Service
Function as a Service
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 

More from Dimitris Tsironis (7)

Automating Front-End Workflow
Automating Front-End WorkflowAutomating Front-End Workflow
Automating Front-End Workflow
 
Modern Webapps
Modern WebappsModern Webapps
Modern Webapps
 
Git 201
Git 201Git 201
Git 201
 
Git 101
Git 101Git 101
Git 101
 
HTML+CSS: how to get started
HTML+CSS: how to get startedHTML+CSS: how to get started
HTML+CSS: how to get started
 
Coffeescript unfancy javascript
Coffeescript unfancy javascriptCoffeescript unfancy javascript
Coffeescript unfancy javascript
 
Coffeescript - take a sip of code
Coffeescript - take a sip of codeCoffeescript - take a sip of code
Coffeescript - take a sip of code
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Capistrano for non-rubyist

  • 2. who we are Dimitris Tsironis Founder at Geembo, UI designer & huge geek, who loves good design and french fries, as much as good indentation in a stylesheet. Follow him @tsironakos and @geemboHQ Dr. John Pagonis Dr. John Pagonis is onto something with Missum these days. You can follow him at @JohnPagonis and @MissumApp
  • 3. WHAT’S THE PROBLEM? deploys can be a real mess mistakes could happen very easily you don’t mess with the production you’re actually delaying bug fixes, new features etc.
  • 4. one-click deploys! (well, almost)
  • 5. is a language agnostic tool for remote application administration tasks provisioning of infrastructure better handled with other tools, eg. Chef, Puppet, Babushka it fits well with deploying web-apps heavily used by Rails community it’s for sysadmins and devops guys
  • 6. how it works under the bonnet
  • 7. philosophy it runs on your computer connects to the server over ssh there is no Capistrano server or sth like that automates the tasks you would manually do with command-line
  • 8. philosophy part ii uses a Ruby-based DSL for task automation there are already ready-to-use tasks cap shell offers an interactive prompt for adhoc commands cap shell sessions are cached and can be reused
  • 9. built-in tasks It ships with plenty of stuff, by default
  • 10. ready-to-use recipes You can find plenty on Github https://github.com/nesquena/cap-recipes Ruby setup & RubyGems management Apache & Phusion Passenger Aptitude management MongoDB and much more!
  • 11. custom tasks Tailor-made Capistrano tasks are easy. It’s all Ruby and Rake-like tasks, after all.
  • 12. how to set it up prepare for the battle
  • 13. set it up you need a Capfile in the root of the project then, you can execute capistrano tasks anywhere in your project’s folder, by running: cap <task name>
  • 15. capify Capify is a file generator for your project usually used with Rails project but it works with other projects in general, it can be enhanced to work with other structures
  • 16. capify One command to generate the files Files you need Capfile - basic Capistrano file in root of the project config/deploy.rb - here’s where you write custom tasks
  • 17. production or staging config/deploy/production.rb config/deploy/staging.rb
  • 18. roles allow you to write capistrano tasks that only apply to certain servers then you can do something like this
  • 19. configuration example config/deploy.rb
  • 20. custom tasks example config/deploy.rb
  • 21. RAILS-specific magic tasks for Ruby on Rails only
  • 22. asset precompile PROBLEM Asset precompile can be slow. It could take several minutes that we could use to make a coffee or watch some cats gifs
  • 23. asset precompile solution Skip precompile, if it isn’t necessary “The ability to destroy a planet is insignificant next to the power of Git” --a tech-savvy Darth Vader
  • 24. rails-specific magic config/deploy.rb Source: StackOverflow of course!
  • 25. RESOURCES Deploying with Capistrano - Github Help https://help.github.com/articles/deploying-with-capistrano Capistrano Wiki https://github.com/capistrano/capistrano/wiki Capistrano Multistage extension https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension Capistrano Handbook - still immature https://github.com/leehambley/capistrano-handbook/blob/master/ index.markdown Capistrano Google Group http://groups.google.com/group/capistrano