Slide 1

Slide 1 text

ROLL OUT Code Deployments that do not suck Srdjan Vranac // code4hire.com // @vranac

Slide 2

Slide 2 text

business owner, developer, consultant, mercenary, writing terrible code that performs exceptionally, wrangling elePHPants and Pythons, obsessed with process automation, interested in continuous integration and delivery, clean code, testing, best practices and distributed systems

Slide 3

Slide 3 text

WARNING!

Slide 4

Slide 4 text

DOCKER?
 NO

Slide 5

Slide 5 text

WHO ARE YOU?

Slide 6

Slide 6 text

STRIVE FOR BETTER

Slide 7

Slide 7 text

CAN YOU…?

Slide 8

Slide 8 text

AS GOOD AS

Slide 9

Slide 9 text

ELEMENTS OF DEPLOYMENT • System deployment • Application deployment • Configuration deployment • Database deployment

Slide 10

Slide 10 text

SYSTEM DEPLOYMENT

Slide 11

Slide 11 text

APPLICATION DEPLOYMENT

Slide 12

Slide 12 text

CONFIGURATION DEPLOYMENT

Slide 13

Slide 13 text

DATABASE DEPLOYMENT

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

MANUAL DEPLOYMENT

Slide 16

Slide 16 text

PUSH TO DEPLOY #!/bin/sh git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f git remote add live ssh://[email protected]/var/repo/site.git

Slide 17

Slide 17 text

ANSIBLE OR SIMILAR

Slide 18

Slide 18 text

FABRIC from fabric.api import *
 from time import strftime, gmtime
 
 env.forward_agent = True
 env.roledefs = {
 'production': ['[email protected]'],
 }
 WEBSITE_PATH = "/var/www/project"
 
 def _deploy_server(version):
 with cd(WEBSITE_PATH):
 run('git fetch')
 run('git reset --hard %s' % version)
 
 @notify
 @task
 def deploy():
 time = strftime("%Y-%m-%d-%H.%M.%S", gmtime())
 tag = "prod-%s" % time
 local('git checkout master')
 local('git tag -a %s -m "Prod"' % tag)
 local('git push --tags')
 env.roles=['production']
 execute(_deploy_server, tag)
 
 @notify
 @task
 def rollback(num_revs=1):
 with cd(WEBSITE_PATH):
 run('git fetch')
 tag = run('git tag -l prod/* | sort | tail -n' + \
 str(1 + int(num_revs)) + ' | head -n1')
 run('git checkout ' + tag)

Slide 19

Slide 19 text

MIGRAINES AND MIGRATIONS • Flyway • Liquibase • c5-db-migration • dbdeploy • mybatis • MIGRATEdb • migrate4j • dbmaintain • AutoPatch

Slide 20

Slide 20 text

CONTINUOUS D*

Slide 21

Slide 21 text

FULL AUTO? YOU NEVER GO FULL AUTO

Slide 22

Slide 22 text

YOU ARE PAID TO MAKE THINGS HAPPEN… FRICTIONLESSLY

Slide 23

Slide 23 text

THANK YOU! QUESTIONS? THE END