In this part of the series, we're going to briefly look at setting up continuous integration with one of our services, using .

    CircleCI is a fantastic tool, and has a very usable free-tier. It's a SaaS, so unlike Jenkins, it's fully managed. I also just find the configuration and set-up very straight forward. also utilises Docker images, so you can be really creative with how you manage your builds.

    Ensuring you've signed-up and created account. First let's create a new project in CircleCI. Down the left-hand menu, click 'add project'. If you've connected your github account to your account, you should see your microservice's git repo appear in the list. Click on 'follow project'. You will then see a page asking what operating system and language you'd like to use. Ensure Linux and Go are selected. And hit start building.

    So in our service (I'm going to use our consignment-service for this), create a new directory in the root and in that directory, create a new file touch .circleci/config.yml. Now let's start adding our build configuration.

    There's something we need to do in order to make this work, I've touched on this a little in the comments, but it's an important step, so I'd like to re-iterate this part.

    We need our google cloud service key, such as the one we created in part 7, and we need to encode this into base64 and store it as an environment variable within our build project settings.

    What this does, is it keeps any secure information within circleci and keeps the repository free of any sensitive data. It keeps these access keys within the control of your ops team, and not just anyone who can access the repo.

    Now in our build config, the contents of that variable are decoded into a file, which is then used to authenticate against our cluster.

      There we have it, pretty simple. We have CI for one of our services. For a production service, you'll probably want to run your tests first, before your deploy step. Take a look at the and check out some of the cool stuff you can do with circle. Because circle uses Docker containers, you can even add a database container, so that you can run integration tests, too. Be creative, make the most of these features!

      Or, sponsor me on Patreon to support more content like this.