43
STILL STUCK WITH FTP OR GIT PULL TO DEPLOY? IT'S HIGH TIME TO EMBRACE AUTOMATED DEPLOYMENT WITH CAPISTRANO Created by / Sumit Chhetri @shhetri , Kumaripati, Lalitpur YIPL

Automated Deployment with Capistrano

Embed Size (px)

Citation preview

Page 1: Automated Deployment with Capistrano

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

OUTLINEWho Am I?Deployment?Deployment GoalsBenefits of AutomatedDeploymentSome Infographics and StatsCapistrano

RequirementsTerminologyDemoFuture of DeploymentAny Questions?Thank You

Page 3: Automated Deployment with Capistrano

WHO AM I?Sumit Chhetri

Software Engineer @ YIPL

DeveloperPHP

Love to code in FrameworkLaravel

Page 4: Automated Deployment with Capistrano

DEPLOYMENT

?

Page 5: Automated Deployment with Capistrano

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

DEPLOYMENT GOALS

Page 7: Automated Deployment with Capistrano

One-click / command deployment

Source: devopsreactions.tumblr.com

Page 8: Automated Deployment with Capistrano

Anytime & Anywhere

Page 9: Automated Deployment with Capistrano

Anyone (with permission) can deploy

Page 10: Automated Deployment with Capistrano

Nominal/No downtime (ZDD - zero downtime deployment)

Page 11: Automated Deployment with Capistrano

Reliable Rollbacks

Pushed code to production, recalled there was a critical bugSource: devopsreactions.tumblr.com

Page 12: Automated Deployment with Capistrano

Reusable and should be reproducible (repeatable)

Page 13: Automated Deployment with Capistrano

Scalable

Page 14: Automated Deployment with Capistrano

BENEFITS OF AUTOMATED DEPLOYMENT

Page 15: Automated Deployment with Capistrano

Deployments become much less error-prone

compared to this...

This simulates a manual deployment

Source: devopsreactions.tumblr.com

Page 16: Automated Deployment with Capistrano

Anyone in the team with permission can deploy software

Page 17: Automated Deployment with Capistrano

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

Deploying to somewhere new is not a headache

Page 19: Automated Deployment with Capistrano

You can release features more frequently as its easy,automated and reproducible

Page 20: Automated Deployment with Capistrano

GOOD, BUT HOW DO DEVELOPERS DEPLOY?

Source: Geshan.com.np

Page 21: Automated Deployment with Capistrano

DEPLOYING WITH FTP NOW IS LIKE...

Source: devopsreactions.tumblr.com

Page 22: Automated Deployment with Capistrano

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

CAPISTRANOA remote server automation and deployment tool written in

Ruby

Page 24: Automated Deployment with Capistrano

Originally a tool for deploying code

Page 25: Automated Deployment with Capistrano

Evolved into remote multi-server automation tool

Page 27: Automated Deployment with Capistrano

Does everything in parallel

Page 28: Automated Deployment with Capistrano

Support these VCS out of the box

1.8 or higherGitMercurialSVN

Page 29: Automated Deployment with Capistrano

Easy to integrate with PHP projects

Page 30: Automated Deployment with Capistrano

We @ chose capistrano because it is popular and mostimportantly fits for our use-case

YIPL

Page 31: Automated Deployment with Capistrano

REQUIREMENTS

Page 32: Automated Deployment with Capistrano

Ruby >= 1.9.3

Page 33: Automated Deployment with Capistrano

recommended with public keys (password less)

SSH access to all servers,

Page 34: Automated Deployment with Capistrano

TERMINOLOGYTaskRecipeNamespaceRoleStages

Page 35: Automated Deployment with Capistrano

TASKA concrete set of commands to execute.

Page 36: Automated Deployment with Capistrano

RECIPEA collection of tasks.

Page 37: Automated Deployment with Capistrano

NAMESPACEOrganizes tasks within recipes and

avoids naming collisions

Page 38: Automated Deployment with Capistrano

ROLEServers can have different roles like

app

demo

web

Page 39: Automated Deployment with Capistrano

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

DEMO

1:33

Page 41: Automated Deployment with Capistrano

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

ANY QUESTIONS???You can drop me a message via

Email :

Facebook :

Twitter :

Visit to read more on this.

[email protected]

[email protected]

https://www.facebook.com/SHhetri

https://twitter.com/shhetri

YIPL-Blog

Page 43: Automated Deployment with Capistrano

THANK YOUGeshan Manandhar

PHP Developers Meetup #14 Team

All of you