1.7 KiB
1.7 KiB
Exercise 11
In this exercise, you will set up a new multi-branch pipeline job and point it to an existing repository on GitHub. You will visualize the pipeline with the standard view and the Blue Ocean plugin. The job uses SonarCloud to capture static code analysis metrics and deploys the application to Heroku. You will need to create accounts for both services to follow along. Both services offer free tiers.
Creating a Pipeline Job
- Have a look at the repository
bmuschko/todo-spring-booton GitHub. The repository already contains the build definition in the form of aJenkinsfile. Identify each of the steps. Fork and clone the repository so you can later on create and push new branches. - In Jenkins, set up the credentials
SONARCLOUD_TOKENandHEROKU_API_KEYif they don't exist yet. The SonarCloud token can be retrieved under My Account > Security. The Heroku API can be generated under Account Settings > API Key. - Create a new multi-branch pipeline job for the repository.
- The initial build is triggered automatically. Have a look at the pipeline in the standard view and its console output.
- Install the Blue Ocean plugin.
- Open the Blue Ocean pipeline visualization for the job. Manually trigger the deployment step. Open a browser with the deployed application on Heroku.
- Create a new branch named
bugfixand push it to the remote repository. The code should be based off ofmaster. - Select "Scan Multibranch Pipeline Now". The job should build the new branch.