With one click

3,307 views
3,112 views

Published on

Deployment presentation, Drupalcon London - August 2011.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,307
On SlideShare
0
From Embeds
0
Number of Embeds
149
Actions
Shares
0
Downloads
18
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • You need a dev environment
  • If you can’t automate deployment, you can’t automate testing.
  • Just add more XML, right?HAProxy, varnish, web, db (master-slave
  • memcache+ SOLR + NAS
  • Zeus, LDAP, ESB, Beanstalkd, External services
  • With one click

    1. 1. With One Click<br />Marcus Deglos<br />Principal Engineer - Capgemini@manarth<br />
    2. 2. Can you make a build with ONE step?<br />
    3. 3. Starting from square one<br />Contract ✔<br />Business analysis ✔<br />Design and wireframes ✔<br />Ready to start coding – right?<br />
    4. 4. Where do you start?<br />Linux VM/WAMP/MAMP/XAMPP/manual install of apache, MySQL, PHP…?<br />Create an empty repository<br />Download latest Drupal to your checkout<br />Start coding?<br />Downloading contrib modules<br />Click + configure<br />Custom modules and themes?<br />
    5. 5. Stop!<br />Have you thought about…<br />Environmental consistency?<br />Deploying to live?<br />Testing?<br />
    6. 6. Two phases<br />Cold start: installing from scratch<br />Updating a live site<br />
    7. 7. Cold start considerations<br />Script everything.<br />Tools include:<br />drush<br />drush make<br />install profiles<br />distributions (which typically use a complex install profile)<br />
    8. 8. Start simple<br />DB<br />Web server<br />Varnish<br />
    9. 9. Deployment – what’s in a name?<br />At its simplest, it’s:Move code from repo to server<br />But there’s more…<br />Switching symlinks<br />Linking up file paths?<br />Clearing caches<br />Running update.php<br />Post-deploy tasks:<br />DB changes?<br />Drush commands?<br />Notify external systems?<br />
    10. 10. Pushing codeIt’s all been done before<br />FTP<br />Manual deployment – SSH/rsync<br />Bash script<br />Rube goldberg machine<br />Capistrano/Webistrano<br />Ant/Phing<br />Jenkins<br />Aegir<br />Drush<br />Git commands<br />RPM packages<br />
    11. 11. Simple tools for simple problems<br />With a simple setup – a single host, or a separate db and web server – a simple deployment tool may be enough.<br />
    12. 12. A simple deployment script<br />#!/bin/bash<br /># Version to deploy<br />version=release-1.0<br /># SVN source of tags. Presume that credentials are already cached.<br />svn=https://svn.example.com/my_web_site/tags<br /># Docroot is a symlink to the current checkout.<br />docroot=/var/www/current<br /># Folder which contains each checkout.<br />destination_folder=/var/www/<br /># Checkout to a timestamped folder (format: YYYYMMDD-HHMM)<br />timestamp=`date +%Y%m%d-%H%M`<br />destination=$destination_folder/$timestamp<br />svntag=$svn/$version<br />svn co $svntag $destination<br /># Switch symlink.<br />rm -f $docroot<br />ln -s $destination $docroot<br /># Clear caches with Drush.<br />drush -l $docroot cc all<br />Slides will be on slideshare.<br />
    13. 13. Enterprise sites: simple<br />HA Proxy<br />HA Proxy<br />Varnish<br />Varnish<br />Web<br />Web<br />DB (master)<br />DB (slave)<br />
    14. 14. Enterprise sites: complex+<br />HA Proxy<br />HA Proxy<br />Varnish<br />Varnish<br />Web<br />Web<br />Memcache<br />SOLR<br />DB (master)<br />DB (slave)<br />NAS/SAN<br />
    15. 15. Enterprise sites: complex++<br />HA Proxy<br />HA Proxy<br />Zeus<br />Zeus<br />Varnish<br />Varnish<br />Web<br />Web<br />Memcache<br />LDAP<br />SOLR<br />ESB<br />DB (master)<br />DB (slave)<br />NAS/SAN<br />
    16. 16. Why is this complex to deploy?<br />Multiple hosts<br />Multiple roles<br />Different actions for different roles<br />
    17. 17. Managing this with a bash script will drive you insane<br />
    18. 18. Deployment concepts<br />Roles<br /><ul><li>Webserver
    19. 19. Reverse proxy
    20. 20. Network management
    21. 21. Data cache
    22. 22. Database
    23. 23. Authentication host</li></ul>Hosts<br /><ul><li>192.168.20.4
    24. 24. web1.example.com</li></ul>Tasks<br /><ul><li>Clear data cache
    25. 25. Checkout code</li></ul>Actions<br /><ul><li>Deploy to stage
    26. 26. Close site for maintenance</li></li></ul><li>Environments, hosts, roles<br />Demo<br />172.16.25.10 = web, cache, db, proxy<br />Live<br />192.168.20.30 = web, cache<br />192.168.20.31 = web, cache<br />192.168.20.32 = web, cache<br />192.168.20.40 = db<br />192.168.20.50 = proxy <br />Environ-ments<br />Hosts<br />Roles<br />
    27. 27. Tasks, actions, targets<br />Recipe<br /><ul><li>Deploy code
    28. 28. Restart memcache</li></ul>Tasks / Recipes<br />Actions<br />Roles<br />
    29. 29. Pushing codeIt’s all been done before<br />FTP<br />Manual deployment – SSH/rsync<br />Bash script<br />Rube goldberg machine<br />Capistrano/Webistrano<br />Ant/Phing<br />Jenkins<br />Aegir<br />Drush<br />Git commands<br />RPM packages<br />
    30. 30. Rube Goldberg deployment<br />
    31. 31. Webistrano<br />
    32. 32. Webistrano: under the hood(live demo)<br />
    33. 33. Alternatives<br />
    34. 34. Alternatives to Webistrano<br />Wednesday 12:30“Aegir: One Drupal to Rule Them All!”<br />Wednesday 15:00“dog: A New Era for Drupal Sitebuilding”<br />Thursday 14:45“DrushDeploy”<br />Jenkins (hudson)<br />Conference sessionsDrupalcon London: August 2011<br />
    35. 35. Beyond deployment<br />
    36. 36. Other tools<br />Environment automation:<br />Puppet<br />Chef<br />Vagrant<br />Fabric<br />Quickstart<br />CI & test tools<br />Jenkins/Hudson<br />Codesniffer<br />Selenium<br />
    37. 37. Questions?<br />Twitter:<br />Blog: <br />Slides:<br />@manarth<br />http://deglos.com/<br />http://www.slideshare.net/manarth<br />

    ×