O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SonarQube

The next thing we will want to do is run a SonarQube scanner. First, let's fix our sonar-project.properties file, which still has chapter7 for projectKey and projectName:

sonar.projectKey=jswebshopsonar.projectName=JS Web Shopsonar.projectVersion=1.0[...]

To invoke the SonarQube scanner, we are going to use a script block. Using the script block, we can define variables and assign them values. In this case, we are going to use the tool command to get the SonarQube location. You can generate the tool command using the snippet generator. After that, we can invoke SonarQube using a shell command. Since it is the PhantomJS tests that will generate the LCOV report, we can run this stage on the Linux node again:

stage('SonarQube') {

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required