Jenkins is the service that provides the pipeline. When a change gets committed to the master branch on github, a webhook will trigger in github which will send a message to jenkins to start a build. Jenkins will grab the JenkinsFile from the github repository to obtain its instructions it has to execute. This JenkinsFiles is set up in stages (see image below). First it will clean the docker images in preparation, then it will make sonarqube scan the code, then it builds the services to docker images which it will also push, at last it will put the created images on the kubernetes cluster.
Jenkins page of my personal project.
In my Jenkins pipeline I have integrated sonarqube as a quality gate. It will scan the code posted on the github repository and give a quality report. It will also show how much of the code is covered by unit tests and the amount of duplicate code. It also shows if the code contains any critical errors. If that is the case it will represent that by dropping the reliability grade.
This scan also shows a result of alot of code smells. This is because I use the default quality profile of java which uses camelCase while I programmed in the more C# way of using PascalCase.
Using sonarqube is a powerful tool in a pipeline as it can automatically shut down builds if it deems the code not safe enough and show why in these kind of reports.
SonarQube report on sonarcloud.io.