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

Building a CI/CD Automation Framework with Ansi...

Building a CI/CD Automation Framework with Ansible and Jenkins

In this slide deck we cover how software/dev teams can architect a framework with all the required tooling, processes, and methods.

WHAT YOU WILL LEARN:

1) How to design simple and complex workflows by connecting your Ansible playbooks with Jenkins.

2) Using Ansible to trigger on-demand infrastructure provisioning, and trigger event-based software testing.

3) Best practices and frameworks to automate governance.

Shadow-Soft

July 26, 2018
Tweet

More Decks by Shadow-Soft

Other Decks in Technology

Transcript

  1. Agenda • Framework Overview • Continuous Integration • Continuous Delivery

    • Continuous Deployment • Feedback Loops • Demo John Ray Practice Manager, DevOps Derrick Sutherland Senior Consultant
  2. A brief history... 1948 Toyota engineers begin the development of

    the Toyota Production System (TPS) 2001 The Agile manifesto is released. 1913 Henry Ford wants to sell more cars. 1981 Waterfall becomes the dominant software development practice. 2009 10 Deploys a Day and DevOps 2010 Continuous Delivery
  3. framework /ˈfrāmˌwərk’/ noun • a basic structure underlying a system,

    concept, or text. "the theoretical framework of CI/CD"
  4. What’s in a Framework? Sociotechnical systems (STS) in organizational development

    is an approach to complex organizational work design that recognizes the interaction between people and technology in workplaces. • coined by Eric Trist, Ken Bamforth and Fred Emery during World War II
  5. What’s in a Framework? Toyota embodied this approach by way

    of Jidoka – meaning "Automation with a human touch"
  6. Framework Principles Reduce Waste • Human Touches • Alerts that

    aren’t useful Feedback • Continuous Improvement • Feedback at all stages Use the right tools • Evangelize • Train Adhere to process • Fix problems from the start • Discipline = Freedom
  7. Continuous Integration The practice of frequently integrating one's new or

    changed code with the existing code repository The main aim of CI is to prevent integration problems, referred to as "integration hell" “Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.” - Martin Fowler
  8. Principles for CI • Maintain a code repository • Everyone

    commits to feature branch daily • All builds must include unit testing • Orchestration system will trigger builds on every commit • Feature branches must be continually merged with baseline
  9. Tools for CI • Build (Maven, Ant, Bazel, etc) •

    Testing (JUnit, Inspec, Findbugs, FindSecBugs, etc) • SCM (Git, SVN, Mercurial, etc) • Orchestration (Jenkins)
  10. Getting Started • Setup a code repository ex. • Setup

    a continuous integration orchestration system ex. • Setup webhook publishing • Install build and testing frameworks on CI system ex. • Build an orchestration pipeline • Ensure code merges with baseline on build
  11. Continuous Delivery Includes all the practices of Continuous Integration and

    takes it a step further to include acceptance testing and artifact release. Ensures products are always reliably releasable “Continuous Delivery is a software development discipline where you build software in such a way that the software can be released to production at any time.” - Martin Fowler
  12. Principles for Continuous Delivery • Deliver to staging environment •

    Maintain valid acceptance and user tests • Release new artifact with every commit
  13. Getting Started • Build a Continuous Integration Pipeline • Install

    automation deployment tools on CI system ex. • Install integration & acceptance testing tools on CI system ex. • Expand pipeline to include staging, further testing and artifact release
  14. Continuous Deployment Includes all the practices of Continuous Delivery and

    takes it a step further to include deploying into production automatically “Continuous Deployment means that every change is deployed through an automated pipeline.”
  15. Principles for Continuous Deployment • Maintain visibility across pipeline •

    Automatically provide feedback to team • Ensure approval before pushing to new environments • Continually deploy releasable code to production systems
  16. Tools for Continuous Deployment Same as Continuous Delivery Additionally… •

    Automation (Ansible, Terraform, etc) • Chatops (Rocketchat, Slack, Hipchat, etc)
  17. Principles for Feedback Loops Alerts must be: • Useful •

    Informative • Actionable • Visible
  18. Getting Started with CI/CD/CD • Select the “right” tools •

    Build your process iteratively • Adhere to the process • Feedback from all stakeholders • Practice continuous improvement
  19. Developers Demo Architecture Pre-Prod (Resource Group) Prod (Resource Group) #General

    channel Master Feature Feature dsutherland1492/jenkinsframeworkapp Pull Build Unit Test Preprod Deploy Preprod Test Prod Deploy Prod Test Merge Create-instance Config Instance Deploy Code Integration Test Merge Acceptance Test
  20. Pipeline git clone 1. build (mvn) 2. unit test (junit)

    3. Notify Success (Rocketchat) 1. Wait for input 2. Deploy with Ansible to Azure PreProd 1. Test with Inspec 2. Notify Success (Rocketchat) 1. Wait for input 2. Deploy with Ansible to Azure Prod 1. Test with Inspec 2. Notify Success (Rocketchat)
  21. CI/CD Framework Review 1. Shadow-Soft will review your existing framework,

    architecture, and tooling 2. You’ll receive recommendations on how to improve processes and governance 3. Learn how other clients are using Ansible and Jenkins for automation Schedule a time with a consultant [email protected]