With One ClickMarcus DeglosPrincipal Engineer - Capgemini@manarth
Can you make a build with ONE step?
Starting from square oneContract ✔Business analysis ✔Design and wireframes ✔Ready to start coding – right?
Where do you start?Linux VM/WAMP/MAMP/XAMPP/manual install of apache, MySQL, PHP…?Create an  empty repositoryDownload latest Drupal to your checkoutStart coding?Downloading contrib modulesClick + configureCustom modules and themes?
Stop!Have you thought about…Environmental consistency?Deploying to live?Testing?
Two phasesCold start: installing from scratchUpdating a live site
Cold start considerationsScript everything.Tools include:drushdrush makeinstall profilesdistributions (which typically use a complex install profile)
Start simpleDBWeb serverVarnish
Deployment – what’s in a name?At its simplest, it’s:Move code from repo to serverBut there’s more…Switching symlinksLinking up file paths?Clearing cachesRunning update.phpPost-deploy tasks:DB changes?Drush commands?Notify external systems?
Pushing codeIt’s all been done beforeFTPManual deployment – SSH/rsyncBash scriptRube goldberg machineCapistrano/WebistranoAnt/PhingJenkinsAegirDrushGit commandsRPM packages
Simple tools for simple problemsWith a simple setup – a single host, or a separate db and web server – a simple deployment tool may be enough.
A simple deployment script#!/bin/bash# Version to deployversion=release-1.0# SVN source of tags. Presume that credentials are already cached.svn=https://svn.example.com/my_web_site/tags# Docroot is a symlink to the current checkout.docroot=/var/www/current# Folder which contains each checkout.destination_folder=/var/www/# Checkout to a timestamped folder (format: YYYYMMDD-HHMM)timestamp=`date +%Y%m%d-%H%M`destination=$destination_folder/$timestampsvntag=$svn/$versionsvn co $svntag $destination# Switch symlink.rm -f $docrootln -s $destination $docroot# Clear caches with Drush.drush -l $docroot cc allSlides will be on slideshare.
Enterprise sites: simpleHA ProxyHA ProxyVarnishVarnishWebWebDB (master)DB (slave)
Enterprise sites: complex+HA ProxyHA ProxyVarnishVarnishWebWebMemcacheSOLRDB (master)DB (slave)NAS/SAN
Enterprise sites: complex++HA ProxyHA ProxyZeusZeusVarnishVarnishWebWebMemcacheLDAPSOLRESBDB (master)DB (slave)NAS/SAN
Why is this complex to deploy?Multiple hostsMultiple rolesDifferent actions for different roles
Managing this with a bash script will drive you insane
Deployment conceptsRolesWebserver
Reverse proxy
Network management
Data cache
Database
Authentication hostHosts192.168.20.4
web1.example.comTasksClear data cache
Checkout codeActionsDeploy to stage
Close site for maintenanceEnvironments, hosts, rolesDemo172.16.25.10 = web, cache, db, proxyLive192.168.20.30 = web, cache192.168.20.31 = web, cache192.168.20.32 = web, cache192.168.20.40 = db192.168.20.50 = proxy Environ-mentsHostsRoles
Tasks, actions, targetsRecipeDeploy code
Restart memcacheTasks / RecipesActionsRoles
Pushing codeIt’s all been done beforeFTPManual deployment – SSH/rsyncBash scriptRube goldberg machineCapistrano/WebistranoAnt/PhingJenkinsAegirDrushGit commandsRPM packages

With one click

  • 1.
    With One ClickMarcusDeglosPrincipal Engineer - Capgemini@manarth
  • 2.
    Can you makea build with ONE step?
  • 3.
    Starting from squareoneContract ✔Business analysis ✔Design and wireframes ✔Ready to start coding – right?
  • 4.
    Where do youstart?Linux VM/WAMP/MAMP/XAMPP/manual install of apache, MySQL, PHP…?Create an empty repositoryDownload latest Drupal to your checkoutStart coding?Downloading contrib modulesClick + configureCustom modules and themes?
  • 5.
    Stop!Have you thoughtabout…Environmental consistency?Deploying to live?Testing?
  • 6.
    Two phasesCold start:installing from scratchUpdating a live site
  • 7.
    Cold start considerationsScripteverything.Tools include:drushdrush makeinstall profilesdistributions (which typically use a complex install profile)
  • 8.
  • 9.
    Deployment – what’sin a name?At its simplest, it’s:Move code from repo to serverBut there’s more…Switching symlinksLinking up file paths?Clearing cachesRunning update.phpPost-deploy tasks:DB changes?Drush commands?Notify external systems?
  • 10.
    Pushing codeIt’s allbeen done beforeFTPManual deployment – SSH/rsyncBash scriptRube goldberg machineCapistrano/WebistranoAnt/PhingJenkinsAegirDrushGit commandsRPM packages
  • 11.
    Simple tools forsimple problemsWith a simple setup – a single host, or a separate db and web server – a simple deployment tool may be enough.
  • 12.
    A simple deploymentscript#!/bin/bash# Version to deployversion=release-1.0# SVN source of tags. Presume that credentials are already cached.svn=https://svn.example.com/my_web_site/tags# Docroot is a symlink to the current checkout.docroot=/var/www/current# Folder which contains each checkout.destination_folder=/var/www/# Checkout to a timestamped folder (format: YYYYMMDD-HHMM)timestamp=`date +%Y%m%d-%H%M`destination=$destination_folder/$timestampsvntag=$svn/$versionsvn co $svntag $destination# Switch symlink.rm -f $docrootln -s $destination $docroot# Clear caches with Drush.drush -l $docroot cc allSlides will be on slideshare.
  • 13.
    Enterprise sites: simpleHAProxyHA ProxyVarnishVarnishWebWebDB (master)DB (slave)
  • 14.
    Enterprise sites: complex+HAProxyHA ProxyVarnishVarnishWebWebMemcacheSOLRDB (master)DB (slave)NAS/SAN
  • 15.
    Enterprise sites: complex++HAProxyHA ProxyZeusZeusVarnishVarnishWebWebMemcacheLDAPSOLRESBDB (master)DB (slave)NAS/SAN
  • 16.
    Why is thiscomplex to deploy?Multiple hostsMultiple rolesDifferent actions for different roles
  • 17.
    Managing this witha bash script will drive you insane
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
    Close site formaintenanceEnvironments, hosts, rolesDemo172.16.25.10 = web, cache, db, proxyLive192.168.20.30 = web, cache192.168.20.31 = web, cache192.168.20.32 = web, cache192.168.20.40 = db192.168.20.50 = proxy Environ-mentsHostsRoles
  • 27.
  • 28.
    Restart memcacheTasks /RecipesActionsRoles
  • 29.
    Pushing codeIt’s allbeen done beforeFTPManual deployment – SSH/rsyncBash scriptRube goldberg machineCapistrano/WebistranoAnt/PhingJenkinsAegirDrushGit commandsRPM packages

Editor's Notes

  • #5 You need a dev environment
  • #6 If you can’t automate deployment, you can’t automate testing.
  • #14 Just add more XML, right?HAProxy, varnish, web, db (master-slave
  • #15 memcache+ SOLR + NAS
  • #16 Zeus, LDAP, ESB, Beanstalkd, External services