BTQ-BUILD: Building the microservices

Building the micrtservices is done via the BTQ-BUILD job, were going to explain how to use it.

The BUILD-BTQ job is made to take the service's name then go inside the repository and build the specific microservice and push it to the ecr with the tag you've provided in the parameter.

Because the pipeline runs in a container we use Kaniko to build the microservices, we use an image that has Kaniko already installed.

We first prepare the ecr by creating the repository in order to give it to the Kaniko to push it, then we activate the Kaniko executor. We give the executor the dockerfile path and the build arguments.

The job takes different parameters affect the build and push process. Each parameter is explained in the parameter description in the Jenkins.

After building one of/ all the images you should see the service has been updated in our website's dashboard indicating a new build map has been submitted.

Service updated

You can that the buildmap (code scan) was updated. If you click on the overall coverage percentage (The 0% in the picture) you will be redirected to "Coverage Report " page for the app where you can see which files and functions have been scanned, you can easily use it to make sure everything was scanned correctly.

Coverage report for the app

You can see they're all 0% for now because no tests have been run on the current build but that should change when running tests. Unless it's a part of an integration build (one of multiple microservices) like our project then the coverage will be on the integration build.

One thing you might notice is that the adservice and cartservice are not updated. That is because the agents we use are CD agents, meaning the scan is done in deployment right before starting the service.

Last updated