ods-core repository contains a build recipe for a central SonarQube instance to which all Jenkins instances send reports to. The remainder of this document describes how that setup is done.
There is an
admin user which is allowed to change settings, install plugins, etc. The password is located in the OpenShift project
cd, inside the
The SonarQube deployment is using an image built in the central ODS namespace. This image is not based on the official SonarQube image on DockerHub, because that requires a specific user to be run under. However, the approach ODS takes is similar to the official image, as can be seen in the ODS Dockerfile.
The SonarQube version which is used is determined by which ZIP file is used.
To update SonarQube, the following steps need to be taken:
Configure new version
Create new image
Rollout new deployment
The following will guide you through this process.
To configure a new version of SonarQube, you need to update the configuration of ODS, which is located in the
ods-configuration repository of your ODS project in Bitbucket. You need to have the latest
master of this repository, as well as the
ods-core repository in your current ODS version available locally. If you don’t want to do this manually, you can make use the
UMBRELLA_DIR=~/opendevstack BITBUCKET_HOST=bitbucket.acme.org BITBUCKET_PROJECT=opendevstack GIT_REF=v3.0.0 mkdir -p $UMBRELLA_DIR && cd $UMBRELLA_DIR curl -LO https://raw.githubusercontent.com/opendevstack/ods-core/$GIT_REF/scripts/repos.sh chmod +x repos.sh ./repos.sh --git-ref $GIT_REF --repos="ods-core,ods-configuration" --source-project https://$BITBUCKET_HOST/scm/$BITBUCKET_PROJECT
The script can also be used in an umbrella directory in which the repositories already exist. Once the repositories are at the desired revision, change
ods-configuration/ods-core.env to your desired version. Commit the change and push it to Bitbucket.
Next, you should ensure that the SonarQube
BuildConfig resource in the central ODS namespace is up-to-date, then trigger a new build so that a new image gets built. Finally, a new deployment should be rolled out which uses the newly built image. All of this can be done from the
This target depends on the targets
configure-sonarqube which execute the steps described above (and can of course also be executed individually).