Upgrade to Pro — share decks privately, control downloads, hide ads and more …

High Stakes Continuous Delivery in the Real World #OpenWest

High Stakes Continuous Delivery in the Real World #OpenWest

You have a robust set of tests and you're using a continuous integration server, so you feel great about your project. You're ready for the next step - continuous delivery. Automatically deploying your changes to production can be a scary prospect for many teams, but in this talk we'll look at some real world examples in high stakes situations where continuous delivery allows teams to move faster and have greater confidence in their code. We'll walk through a sample CI/CD setup used on a real-world PHP-based ecommerce site and show how you can use this setup for your projects.

Joshua Warren

May 07, 2015
Tweet

More Decks by Joshua Warren

Other Decks in Technology

Transcript

  1. OR:

  2. Founder & CEO Founded Creatuity in 2008 PHP Development Firm

    Focused on the Magento platform Some of our developers, October ‘12
  3. CI Server • Bamboo, Jenkins or ? - choice is

    yours • Our examples will use Bamboo
  4. Bamboo Testing • Configure it to your liking • We

    use phing, phpunit, etc • Must define an artifact, but can be empty
  5. Bamboo Deployments • Create a deployment project • Define an

    environment - in our case, ‘Staging’ • Attach it to your build plan used for testing
  6. Bamboo Tasks • Tasks are where the magic happens •

    We use tasks to trigger our deployment system, rocketeer
  7. #OpenWest Four short tasks in Bamboo are all it takes

    to automate deploying your PHP projects.
  8. #OpenWest Bamboo + Rocketeer takes us from passed test to

    deployment in less than half an hour with no manual steps.
  9. .rocketeer/hooks.php 'before' => [ 'setup' => [], 'deploy' => array(

    'magerun sys:maintenance --on' ), 'cleanup' => [], ],
  10. .rocketeer/hooks.php 'after' => [ 'setup' => [], 'deploy' => [],

    'cleanup' => array( 'magerun sys:setup:run', 'magerun cache:clean', 'magerun cache:flush', 'magerun index:reindex:all', 'magerun sys:maintenance --off', ), ],
  11. Next Up • Commit these changes to your Rocketeer files

    • Prepare your server to receive the deployment
  12. File Structure • current and releases are managed by Rocketeer

    • shared contains folders shared by each release
  13. Rocketeer Folder Structure • Rocketeer deploys to a new folder

    under releases • Updates symlinks to shared folder • Then updates current symlink to new release
  14. Rocketeer Prep • Make sure SSH keys are setup correctly

    • Rocketeer will connect to your SSH repo via your server - before running deploy for the first time, test your SSH setup
  15. Feature Toggles • First step of implementing a new feature

    - wrap it in a feature toggle • Code only executes if feature is enabled • Enables deploying new code immediately
  16. Canaries • Deploy to a small portion of your site’s

    traffic • Compare error rates between new & old version • If error rate is same or lower, deploy globally
  17. Don’t get distracted by these advanced concepts - start by

    moving to basic continuous delivery first.