Skip to content

eddiewebb/demo-blueskygreenbuilds

Repository files navigation

Circle CI Demo

Build, Test and Deploy a modern webapp using CircleCI.

Technologies covered:

  • Build a Spring Boot app with Maven (and caching maven repos!)
  • Packaged as docker image (without daemon!) using Google Jib
  • Browser testing with Selenium and Saucelabs (disabled account :( )
  • Static Code Analysis with SonarQube (disabled account :( )
  • Manual Approval/Promotion
  • Canary deployment to Kubernetes cluster using Vamp.io Release Orchestration policies.

CircleCI Maintainability Test Coverage

Testing

To test simple UI functionality we're using Spring Boot's test starter and SauceLabs Connect Tunnel binaries driven through Selenium's WebDriver interface. The use of SauceLabs let's us run several browser combinations in parallel.

You can see these simple tests in HomePagesTests.java

Release Orchestration example

We can use a PaaS/FaaS cluster and canary or blue/green releases for zero-downtime deployments using Blue/Green strategy.

  1. deploy new version of service as container image (i.e. in dockerhub, ecr, etc)
  2. Rollout new image to XX% of traffice, or by cohort
  3. Monitor key metrics like heatlh and activity to determine validity of new version
  4. Automatically fail or proceed rollout.

Viewing

And live app visible on http://blueskygreenbuilds.com

Interesting Things

  • We're using a service account in CircleCI to apply the deployment
  • Traffic is shaped via contour as influence by Vamp policies
  • We grab a visual of the routes from contour and save as artifact in build
  • Spring Boot app is exposing a metrics API that prometheus scrape, which can drive custom policy metrics.

A completed release with healthy metrics

Running locally

This project uses spring boot, so run as you would any other like project to start on port :8080 locally.

mvn spring-boot:run

Demo

See demo-assets