SlideShare a Scribd company logo
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

More Related Content

With one click

Editor's Notes

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