Skip to content

Building

Peter Mount edited this page Feb 26, 2018 · 3 revisions

Jenkins build

The Jenkins build runs a pipeline defined in the file Jenkinsfile in the root of the repository. This pipeline defines 7 steps:

  • Checkout checks out the branch being built, pulls the current golang development image then ensures that all required libraries are pulled out.
  • Run Tests runs the unit tests.
  • Then comes a step for each microservice. Each of these will build the service for each supported platform.
  • Finally Multiarch Image will build the final images for each microservice based on the previous builds and pushes it to docker hub. This is the magic which allows our images to run on any supported platform using the same image names!

Note: This final Multiarch image requires you to be using a recent version of docker with experimental cli functions added. This is because the docker manifest command is still experimental.

Building locally

To aid development & testing there's a shell script in the project root called build.sh. You can run this command to build each microservice:

syntax

./build.sh _imageName_ _microservice_ _platform_ _version_
  • imageName The image name to create locally, usually I use test
  • microservice The service to build, one of darwinref, darwintt, darwind3 or ldb
  • platform The architecture to build, one of amd64 or arm64v8 - usually match that of your development environment.
  • version The version to build, usually just use latest

Running this command will build an image locally called imageName:microservice-platform-version

Generating documentation

The API documentation (README.md within each library) is generated from the sources via the gendocs.sh script. You simply need to run it and it will update the README.md files accordingly.

Clone this wiki locally