Skip to content

continuous integration

Walter Pinson edited this page Dec 18, 2017 · 7 revisions

Continuous Integration

The reference architecture uses CircleCI for continuous integration and in support of continuous deployment. The CircleCI configuration files are located in the repository at ./circleci/config.yml.

CircleCI Workflow

CircleCI

The CircleCI workflow feature allows us to create several jobs and chain them together in different configurations. There are three jobs defined in this CircleCI configuration file.

  1. build
  2. test_integration
  3. deploy_to_dockerhub

These jobs are chained together in four different workflows.

  1. buid_only
  2. build_test
  3. build_test_deploy
  4. build_deploy

Jobs

Build (build)

This is the fundamental build job. It is somewhat of a misnomer in that it doesn't just build the source code. It also runs the unit tests. There are no jobs that build the source code without, at least, running the unit tests.

The build job is responsible for the following:

  1. Check out the source code
  2. Build the solution
  3. Run the unit tests
  4. Publish the Infrastructure.WebApi application
  5. Store the publish assets and the integration test source code in the newly defined workspace (temporary storage)

Test Integration (test_integration)

This job runs the integration tests. It is completely dependent on the build job as it expects the compiled source build artifacts to already be present in the workspace.

The test_integration job is responsible for the following:

  1. Attach to the workspace
  2. Run integration test project #1
    1. Build integration test project #1
    2. Execute integration test prject #1
  3. Run integration test project #n

Deploy to Docker Hub (deploy_to_dockerhub)

This job publishes the docker Reference Architecture API docker image to the Docker Hub repository so that it can be used by downstream continuous deployment processes to deploy the application to various environments.

The deploy_to_dockerhub job is responsible for the following:

  1. Build docker image
  2. Tag docker image
  3. Log in to Docker Hub
  4. Push docker image to docker hub

Workflows

Build Only (buid_only)

Use this workflow to build the application and run unit tests.

Build and Test (build_test)

Use this workflow to build the applicaton, run unit tests, and also run the integration tests.

Build, Test, and Deploy (build_test_deploy)

Use this workflow to build the application, run the unit tests, run the integration tests, and also deploy the resultant docker image to Docker Hub.

Build and Deploy (build_deploy)

Use this workflow to build the application, run the unit tests, and deploy the resultant docker image to Docker Hub.

This workflow is intended for the use case where it is okay to deploy the docker image without running the integration tests.