Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Blueriq Quality Gate called bma-qualitygate-installer.jar can be runs by using java -jar bma-qualitygate-installer.jar. When running this command you will be prompted with several questions.

Prompt

Input

hostnameThe url to your SonarQube instance. This should be either yoururl.here[:PORT] or http[s]://yoururl.here[:PORT]/
usernameA username for a user with the Administer Quality Gates permission. (default: admin)
passwordThe password for the above mentioned user. (default: admin)

Clean install? (y/n)

Decide whether to delete the current quality gate and overwrite it with a new one. If the answer is not "Y", the script will only install missing conditions.

Info
titlecommand line arguments

It is possible pass command line arguments into the bma-qualitygate-installer.jar for information see Quality Gate Installer

...

See the User documentation on how to execute an analysis of your Blueriq Models.

Enforcing the Quality Gate in a Jenkins pipeline

To enforce the Quality Gate in Jenkins you can use the SonarQube Scanner plugin. To configure the BMA you can follow the provided example configuration of this plugin. The only way the BMA configuration deviates from this example is in the way it triggers the analysis.

Instead of using the "sh 'mvn clean package sonar:sonar'" command, use the "java -jar  <location on disk>\bma-sonar-scanner.jar" command to trigger the analysis.

Example pipeline:

Code Block
pipeline {
        agent none
        stages {
          stage("BMA SonarQube analysis") {
            agent any
            steps {
              withSonarQubeEnv('My SonarQube Server') {
                java -Dspring.config.location=file:C:\bma\application.properties -jar C:\bma\bma-sonar-scanner.jar
              }
            }
          }
          stage("Quality Gate") {
            steps {
              timeout(time: 1, unit: 'HOURS') {
                waitForQualityGate abortPipeline: true
              }
            }
          }
        }
      }