"Roll out" - Code deployments that do not suck

"Roll out" - Code deployments that do not suck

How comfortable are you when deploying your code?
Is your deployment process streamlined and automated?
Can you deploy to multiple servers?
How do you deal with database migrations?
In this talk we will go over some of the options available and the challenges you will be facing while trying to setup frictionless deployments.

F2d82b268a7cbccc9809c939428df64f?s=128

Vranac Srdjan

March 12, 2016
Tweet

Transcript

  1. ROLL OUT Code Deployments that do not suck Srdjan Vranac

    // code4hire.com // @vranac
  2. 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
  3. WARNING!

  4. DOCKER?
 NO

  5. WHO ARE YOU?

  6. STRIVE FOR BETTER

  7. CAN YOU…?

  8. AS GOOD AS

  9. ELEMENTS OF DEPLOYMENT • System deployment • Application deployment •

    Configuration deployment • Database deployment
  10. SYSTEM DEPLOYMENT

  11. APPLICATION DEPLOYMENT

  12. CONFIGURATION DEPLOYMENT

  13. DATABASE DEPLOYMENT

  14. None
  15. MANUAL DEPLOYMENT

  16. 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://user@mydomain.com/var/repo/site.git
  17. ANSIBLE OR SIMILAR

  18. FABRIC from fabric.api import *
 from time import strftime, gmtime


    
 env.forward_agent = True
 env.roledefs = {
 'production': ['ubuntu@xxx.xxx.xxx.xxx'],
 }
 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)
  19. MIGRAINES AND MIGRATIONS • Flyway • Liquibase • c5-db-migration •

    dbdeploy • mybatis • MIGRATEdb • migrate4j • dbmaintain • AutoPatch
  20. CONTINUOUS D*

  21. FULL AUTO? YOU NEVER GO FULL AUTO

  22. YOU ARE PAID TO MAKE THINGS HAPPEN… FRICTIONLESSLY

  23. THANK YOU! QUESTIONS? THE END