Automation and the Deployment Pipeline


Published on

This is the deck for a [number of] talks I do on Continuous Delivery and where automation fits into each step of getting code out of a product owner's imagination and into the hands of eager users.

1 Comment
  • Some more DevOps for websphere:
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Automation and the Deployment Pipeline

  1. 1. Automation & the Deployment Pipeline Adam Goucher @adamgoucher adam@element34.caThis workshop is about the various forms of automation that happens in the Deployment Pipeline.On this slide we talk about:- The Going Camping Heuristicphoto credit:
  2. 2. End-user PerspectiveFrom the end-user perspective, your application just delivers its <thing> to credit:
  3. 3. RealityWe know that the reality is slightly different. But even this is well organized and logical -- if you understand the credit:
  4. 4. An Ethical DistinctionOn this slide we talk about:- Continuous Delivery vs Continuous Deployment
  5. 5. The Lightsaber HeuristicThere are commercial tools available to do all this stuff. Instead, we’ll use all open-source tools to build a custom solution.On this slide we talk about:- The Lightsaber Heuristicphoto credit:
  6. 6. Lots of parts, working togetherTo have a fully automated deployment pipeline, there are /lots/ of moving parts. The big ones are- acceptance criteria- configuration management- continuous integration- data migration- deployment- functional test automation- immunization systems.We will be talking about each of thesephoto credit:
  7. 7. The best way to illustrate all these things is to do them live. As a result, we will create a Ruby-on-Rails application and have push it through eachpart of the Deployment Pipeline. Both the application and all the pipeline support code will be made available shortly after the workshop.
  8. 8. SpecificationsIt can be argued when the Pipeline really starts. So lets start from the beginning; with acceptance criteria.On this slide we talk about:- Specification Workshops- Given / When / ThenI’m not a fan of any of the current BDD/ATDD tools from an automation perspective, but going through the exercise of producing thespecifications absolutely has credit:
  9. 9. Manual InspectionFor our purposes though, the automation part begins when someone inspects their change as to whether it is time to credit:
  10. 10. CommitThere is one path through the pipeline and our Commit starts it.On this slide we talk about:- Check-in vs. Commit- Clean vs. dirty trunk- Pre-Commit checks- Commit checks- Post-Commit checksphoto credit:
  11. 11. ‘Cans’Once our code is versioned, we need to have machines to run our checks against.On this slide we talk about:- Machines as ‘cans’photo credit:
  12. 12. PuppetPuppetOn this slide we talk about:- Puppet vs. Chef vs. Cfengine- What Configuration Management is.... and isn’tAnd we provision our server, demonstrating how Puppet controls- packages- services- users/groupsphoto credit:
  13. 13. Continuous IntegrationWith a machine to run things again, we now turn our attention to the control center of the whole Pipeline; the Continuous Integration credit:
  14. 14. JenkinsJenkins (part one)On this slide we talk about:- Role of CI- Jenkins vs. HudsonAnd we configure Jenkins for our application, demonstrating- Jobs- Job chains- Authentication- Remote agents- Reporting- Notifications- Plugins
  15. 15. Data MigrationData Migration is tricky. To say the least. But getting it right is critical to getting your pipeline fully automatedOn this slide we talk about:- Up- Down- IdempotencyBecause we’re using Ruby-on-Rails, we’ll use ActiveRecord Migrations for our pipeline but we’ll also look at dbdeployphoto credit:
  16. 16. DeploymentCompared to everything else before now, pushing the code out onto the server(s) is a snap.On this slide we talk about:- Zero-downtime deploys- RollbacksMost ‘platforms’ have a deployment tool that has grown with it. For our deployments, we’ll be using Capistrano. Cap is not limited to just Ruby-on-Rails deployments though so we’ll talk about how to customize it for a number of different credit:
  17. 17. Functional AutomationSo we’re finally at the point where we can do some ‘traditional’ automation. And since our stack is all Open Source, we’re going to use credit:
  18. 18. Papers pleaseUniquely identifying things on the page is one of the hardest parts about doing web automation. And is one of the main reasons scripts are‘brittle.’On this slide we talk about:- attribute-based locators- structural locators- when to use which locatorphoto credit:
  19. 19. SynchronizationThe other common pain point for web automation is synchronizing the script steps with the applicationOn this slide we talk about:- Web 1.0- Web 2.0- Web 2.0++photo credit:
  20. 20. RandomnessIntroducing randomness into your scripts is important -- use it!On this slide we talk about:- Providers- Oraclesphoto credit:
  21. 21. Pesticide ParadoxImagine you are a farmer...On this slide we talk about:- The Pesticide Paradoxphoto credit:
  22. 22. Land mine problemYou should find the mines.Not.Your.Customer.On this slide we talk about:- The Land Mine Problem- Continuous Delivery vs. Continuous Deploymentphoto credit:
  23. 23. TagsManual built suites of scripts is a code smellOn this slide we talk about:- Tags- Tag taxonomies- Script discovery- Parallel execution- Random executionphoto credit:
  24. 24. Page ObjectsPage Objects bring the power of OO to automationOn this slide we talk about:- Page ObjectsFor our project, we will construct some Page Object based Selenium scripts using RSpec. Though we can discuss and/or create examples of themin other languages credit:
  25. 25. Jenkins (Redux)Jenkins (again)On this slide we talk about:- Using Jenkins as a replacement for se-grid- Advanced job chaining
  26. 26. Immunization SystemsImmunizations shots keep you healthy. Immunization systems keep your deployments healthy.On this slide we talk about:- Immunization Systems- Business vs. Technical metrics- Incremental deployments- Automated rollbackIn order to ensure our deployment will not negatively impact our users, we will build a basic Immunization System for our application. By theirnature, these are highly customized per credit:
  27. 27. G-ForcesKent Beck uses the notion of G-Forces to explain how things respond to speeding up your process. With a fully automated deployment pipelinethings will be able to go faster. And faster.But you could also get thrown from the carousel, so be careful.On this slide we talk about:- Kent Beck’s G-Forcesphoto credit:
  28. 28. Adam Goucher @adamgoucher adam@element34.caphoto credit: