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

RAX.IO 2015 CI/CD

Avatar for dimitry dimitry
February 26, 2015
110

RAX.IO 2015 CI/CD

Avatar for dimitry

dimitry

February 26, 2015
Tweet

Transcript

  1. What is CI/CD? • Automating the process of merging upstream

    and downstream code • Running code against unit, functional and performance tests • Deploying code to an environment
  2. Why CI/CD? • Automate the build • Make the build

    self testing • Keep the build fast • Everyone can see what’s happening • Automate deployment
  3. Intro to Tools • Jenkins – CI/CD pipeline tool •

    Gerrit – code review tool used by OpenStack • Gatling – performance testing tool • Ansible – infrastructure automation tool • SonarQube – code quality management tool
  4. Goals for this Workshop Set up and execute CI/CD for

    an internal project based on an OpenStack project. Workflows: 1) Basic workflow that merges upstream OpenStack with downstream internal project 2) Workflow triggered by an upstream, pre-merged Gerrit patch 3) Workflow triggered by a GitHub pull request
  5. 1st Workflow – Upstream/Downstream Merge 2) Clone the downsteam, forked

    repository. 3) On a new branch, change the value of title in app.py from to “Downstream, Internal Project.” 4) Commit this change and push it to the downstream repo on the new branch.
  6. 1st Workflow – Upstream/Downstream Merge 5) In the Rax-io-build repository,

    add the commit to /patches/downstream. 6) In Jenkins, build “raxio_jobs_data_public_upstream_merge”
  7. 1st Workflow – Upstream/Downstream Merge + = Upstream code Downstream

    code Combined code Unit tests Func tests Sonar Qube Perf tests Perf tests Perf tests
  8. Continuous Integration Steps • Fetch upstream • Merge upstream and

    downstream • Unit Tests • Functional Tests • Performance Tests • SonarQube Metrics Analysis • Update downstream master branch
  9. Continuous Deployment Steps • Create an artifact as a new

    release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com
  10. Continuous Deployment Steps • Create an artifact as a new

    release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com b-staging-api.rackspace.com
  11. Continuous Deployment Steps • Create an artifact as a new

    release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com b-staging-api.rackspace.com Functional Tests
  12. Continuous Deployment Steps • Create an artifact as a new

    release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com b-staging-api.rackspace.com
  13. Continuous Deployment Steps • Create an artifact as a new

    release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com b-staging-api.rackspace.com Functional Tests
  14. Continuous Deployment Steps • Create an artifact as a new

    release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com
  15. 2nd Workflow – Gerrit Patch 1) A patch is submitted

    upstream to Gerrit 2) This patch triggers “raxio_jobs_data_upstream_patch_trigger,” which begins workflow 3) Any conflicts or test failures are reported either through email or to the Gerrit patch
  16. 3rd Workflow – Github PR 1) Add webhook to GitHub

    repository. • Under Settings -> Webhooks & Services -> Add Webhook • Payload URL: <uuid>.ngrock/ghprbhook/ • Content Type: application/x-www-form-urlencoded • Leave “Secret” blank. • Select “Let me select individual events.” ◦ Pull Requests ◦ Issue Comment ◦ Active
  17. 3rd Workflow – Github PR 1) Make a commit on

    a new branch and open a pull request. 2) This pull request will trigger “raxio_jobs_data_downstream_patch_trigger.” 3) Jenkins will comment on pull request.