Jenkins SonarQube step go to Warn

Viewed 774

I am slowly diving in to the pipeline groovy dsl of Jenkins. And I am trying to figure out how I can create a step that does sonar and reflects the quality gate message in the Jenkins buildserver.

At this moment I have the folowing step definded for sonar:

stage ('sonar') {
  mvn "-Dsonar.lang.patterns.jsp=notverified -Dsonar.host.url=http://sonar.server.example:9494 org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar -Dsonar.login=key
}

Now I want that when Maven gets the :

[INFO] Quality gate status: WARN

that it does not set it on OK or Error but makes that build step go WARN as well (so instead of the nice green or red a nice color of Yellow). I have been digging trough the documentation but as far as I can tell there is no real way to make a Step go to WARN state in any way its in essense binary. And there is noting in between any one a idea?

1 Answers
Related