Still stuck with FTP or git pull to deploy?

It's high time to embrace Automated Deployment with Capistrano


Created by Sumit Chhetri / @shhetri

YIPL , Kumaripati, Lalitpur

Outline

  • Who Am I?
  • Deployment?
  • Deployment Goals
  • Benefits of Automated Deployment
  • Some Infographics and Stats
  • Capistrano
  • Requirements
  • Terminology
  • Demo
  • Future of Deployment
  • Any Questions?
  • Thank You

Who AM I?

Sumit Chhetri

Software Engineer @ YIPL

PHP Developer

Love to code in Laravel Framework

Deployment

?

Deployment

Software deployment is all of the activities that make a software system available for use

  • copy/clone code base to server
  • run composer commands
  • migrate your database
  • reload the web server
  • notify about the deployment
  • and so on...

Deployment Goals

One-click / command deployment

Anytime & Anywhere

Anyone (with permission) can deploy

Nominal/No downtime (ZDD - zero downtime deployment)

Reliable Rollbacks

Pushed code to production, recalled there was a critical bug

Reusable and should be reproducible (repeatable)

Scalable

Benefits of Automated Deployment

Deployments become much less error-prone

compared to this...

This simulates a manual deployment

Anyone in the team with permission can deploy software

Engineers will spend most of their time developing software

and not have to face this kind of situation...

Problematic deployment is over

Deploying to somewhere new is not a headache

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

Good, but how do developers deploy?

Deploying with FTP now is like...

Deployment tools, what are the popular ones

Tool Written In Github Stars Github Watchers
Capistrano Ruby 7476 329
Fabric Python 5833 316
Mina Ruby 2701 90
Rocketeer PHP 1731 81
Deployer PHP 1334 85
Source: Github.com, data from 04-Sep-2015

Capistrano

A remote server automation and deployment tool written in Ruby

Originally a tool for deploying code

Evolved into remote multi-server automation tool

Uses SSH

Does everything in parallel

Support these VCS out of the box

Easy to integrate with PHP projects

We @ YIPL chose capistrano because it is popular and most importantly fits for our use-case

Requirements

Ruby >= 1.9.3

SSH access to all servers,

recommended with public keys (password less)

Terminology

  • Task
  • Recipe
  • Namespace
  • Role
  • Stages

Task

A concrete set of commands to execute.

Recipe

A collection of tasks.

Namespace

Organizes tasks within recipes and

avoids naming collisions

Role

Servers can have different roles like

app

demo

web

Stages

Refers 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.

Demo

Future of deployment

Chat ops with deploying from Hipchat using Hubot

Docker deployment but looks like a problem in Internet challenged Nepal :)

Any Questions???

You can drop me a message via

Email : sumit.chhetri@yipl.com.np
er.sumit.chhetri@gmail.com
Facebook : https://www.facebook.com/SHhetri
Twitter : https://twitter.com/shhetri


Visit http://blog.yipl.com.np/automated-deployment to read more on this. And http://blog.yipl.com.np for more interesting stuffs.

Thank you

Geshan Manandhar

PHP Developers Meetup #14 Team

All of you