Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Connecting to the Virtual Machine using SSH
lock
Launch Jenkins and SonarQube Docker Containers
lock
Login to SonarQube and Generate Security Token
lock
Log in to Jenkins and Complete the Default Installation
lock
Install and Configure SonarQube and Gradle Plugins
lock
Create and Execute Jenkins Pipeline Gradle Job
lock
Review SonarQube Static Analysis Report
lock
Validate AWS Lab
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

Introduction

In this Lab Step, you will continue using the Jenkins administration web console. You will now install the Gradle and SonarQube Scanner plugins, required to perform a build and static code analysis. You will configure the SonarQube Scanner plugin to authenticate against SonarQube using the security token you generated in the previous Lab Step.

 

Instructions

Install SonarQube Scanner Plugin

1. Click on the Manage Jenkins menu item taking you into the Manage Jenkins screen. Ignore any update and/or security messages that Jenkins may announce as this is a Lab environment only:

alt

2. Click on the Manage Plugins menu item taking you into the Plugin Manager:

alt

3. Click the Available tab and enter SonarQube within the search input field associated with the Plugins Manager pane. Select the SonarQube Scanner option and click Install without restart:

alt

4. Ensure that the SonarQube Scanner plugin has been installed successfully as per the Success status at the bottom of the plugins list and click Go back to the top page:

alt 

5. Click on the Manage Jenkins > Global Tool Configuration menu item:

alt

6. Under SonarQube Scanner, click Add SonarQube Scanner. Enter sonar in the Name field and ensure that the Install automatically checkbox is ticked. Then select the SonarQube Scanner 3.2.0.1227 version under Install from Maven Central. Click Apply to commit the SonarQube Scanner plugin installation settings:

alt 

Install Gradle Plugin

7. Staying on the Global Tool Configuration screen, scroll back up. Under Gradle, click Add Gradle. Enter gradle-4.10.2 in the Name field and ensure the Install automatically checkbox is ticked. Then select the Gradle 4.10.2 version under Install from Gradle.org. Click Apply to commit the Gradle plugin installation settings:

alt

8. Click  Save and return to the Jenkins home page by clicking the Jenkins logo:

alt

Configure SonarQube Credentials

9. Click Credentials to be taken into the Credentials screen:

alt

10. Hover over and click the _(global) link, then click the Add credentials context menu item:

alt

11. Set Kind to Secret text, and ensure that the Scope is set to Global, then set:

Secret: Enter the secret token value you generated in the SonarQube application in the previous Lab Step

ID:

Copy code
sonar

Description:

Copy code
sonar

 

alt

12. Click OK to commit the SonarQube secret token into the Jenkins credentials secured storage area. Finally, return to the Jenkins home page by clicking the Jenkins logo:

alt 

Summary

In this Lab Step, within the Jenkins administration web console, you installed and configured the SonarQube Scanner and Gradle plugins. Finally, you configured the SonarQube credential security token, securely storing it within Jenkins. In the next Lab Step, you will configure a build-and-test pipeline that leverages both of these plugins.