automated deployment with capistrano
TRANSCRIPT
![Page 1: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/1.jpg)
STILL STUCK WITH FTP OR GIT PULL TODEPLOY?
IT'S HIGH TIME TO EMBRACE AUTOMATEDDEPLOYMENT WITH CAPISTRANO
Created by / Sumit Chhetri @shhetri
, Kumaripati, LalitpurYIPL
![Page 2: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/2.jpg)
OUTLINEWho Am I?Deployment?Deployment GoalsBenefits of AutomatedDeploymentSome Infographics and StatsCapistrano
RequirementsTerminologyDemoFuture of DeploymentAny Questions?Thank You
![Page 3: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/3.jpg)
WHO AM I?Sumit Chhetri
Software Engineer @ YIPL
DeveloperPHP
Love to code in FrameworkLaravel
![Page 4: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/4.jpg)
DEPLOYMENT
?
![Page 5: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/5.jpg)
DEPLOYMENT is all of the activities that make a
software system available for useSoftware deployment
copy/clone code base to serverrun composer commandsmigrate your databasereload the web servernotify about the deploymentand so on...
![Page 6: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/6.jpg)
DEPLOYMENT GOALS
![Page 7: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/7.jpg)
One-click / command deployment
Source: devopsreactions.tumblr.com
![Page 8: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/8.jpg)
Anytime & Anywhere
![Page 9: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/9.jpg)
Anyone (with permission) can deploy
![Page 10: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/10.jpg)
Nominal/No downtime (ZDD - zero downtime deployment)
![Page 11: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/11.jpg)
Reliable Rollbacks
Pushed code to production, recalled there was a critical bugSource: devopsreactions.tumblr.com
![Page 12: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/12.jpg)
Reusable and should be reproducible (repeatable)
![Page 13: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/13.jpg)
Scalable
![Page 14: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/14.jpg)
BENEFITS OF AUTOMATED DEPLOYMENT
![Page 15: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/15.jpg)
Deployments become much less error-prone
compared to this...
This simulates a manual deployment
Source: devopsreactions.tumblr.com
![Page 16: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/16.jpg)
Anyone in the team with permission can deploy software
![Page 17: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/17.jpg)
Engineers will spend most of their time developing software
and not have to face this kind of situation...
Problematic deployment is over
Source: devopsreactions.tumblr.com
![Page 18: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/18.jpg)
Deploying to somewhere new is not a headache
![Page 19: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/19.jpg)
You can release features more frequently as its easy,automated and reproducible
![Page 21: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/21.jpg)
DEPLOYING WITH FTP NOW IS LIKE...
Source: devopsreactions.tumblr.com
![Page 22: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/22.jpg)
DEPLOYMENT TOOLS, WHAT ARE THE POPULARONES
Tool Written In Github Stars Github Watchers
Ruby 329
Python 316
Ruby 90
PHP 81
PHP 85
Capistrano 7476
Fabric 5833
Mina 2701
Rocketeer 1731
Deployer 1334Source: , data from 04-Sep-2015Github.com
![Page 23: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/23.jpg)
CAPISTRANOA remote server automation and deployment tool written in
Ruby
![Page 24: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/24.jpg)
Originally a tool for deploying code
![Page 25: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/25.jpg)
Evolved into remote multi-server automation tool
![Page 27: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/27.jpg)
Does everything in parallel
![Page 28: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/28.jpg)
Support these VCS out of the box
1.8 or higherGitMercurialSVN
![Page 29: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/29.jpg)
Easy to integrate with PHP projects
![Page 30: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/30.jpg)
We @ chose capistrano because it is popular and mostimportantly fits for our use-case
YIPL
![Page 31: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/31.jpg)
REQUIREMENTS
![Page 32: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/32.jpg)
Ruby >= 1.9.3
![Page 33: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/33.jpg)
recommended with public keys (password less)
SSH access to all servers,
![Page 34: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/34.jpg)
TERMINOLOGYTaskRecipeNamespaceRoleStages
![Page 35: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/35.jpg)
TASKA concrete set of commands to execute.
![Page 36: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/36.jpg)
RECIPEA collection of tasks.
![Page 37: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/37.jpg)
NAMESPACEOrganizes tasks within recipes and
avoids naming collisions
![Page 38: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/38.jpg)
ROLEServers can have different roles like
app
demo
web
![Page 39: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/39.jpg)
STAGESRefers to each environment being a stage like dev, staging,
testing, production.
Usually means different set of servers.
Can also include configuration per stage.
Or even different tasks.
![Page 40: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/40.jpg)
DEMO
1:33
![Page 41: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/41.jpg)
FUTURE OF DEPLOYMENT with deploying from Hipchat using HubotChat ops
deployment but looks like a problem in Internetchallenged Nepal :)
Docker
![Page 42: Automated Deployment with Capistrano](https://reader034.vdocuments.mx/reader034/viewer/2022042509/587bdf451a28ab834d8b728f/html5/thumbnails/42.jpg)
ANY QUESTIONS???You can drop me a message via
Email :
Facebook :
Twitter :
Visit to read more on this.
https://www.facebook.com/SHhetri
https://twitter.com/shhetri
YIPL-Blog