Share
Embed
RAX.IO 2015 CI/CD
dimitry
February 26, 2015
Transcript
19 slides
-
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 -
Why CI/CD? • Automate the build • Make the build
self testing • Keep the build fast • Everyone can see what’s happening • Automate deployment -
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 -
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 -
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. -
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” -
1st Workflow – Upstream/Downstream Merge + = Upstream code Downstream
code Combined code Unit tests Func tests Sonar Qube Perf tests Perf tests Perf tests -
Continuous Integration Steps • Fetch upstream • Merge upstream and
downstream • Unit Tests • Functional Tests • Performance Tests • SonarQube Metrics Analysis • Update downstream master branch -
Continuous Deployment Steps • Create an artifact as a new
release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com -
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 -
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 -
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 -
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 -
Continuous Deployment Steps • Create an artifact as a new
release • Blue/Green deployment against staging • Blue/Green deployment against production staging-api.rackspace.com -
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 -
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 -
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.