Jenkins Pipeline Exploration
Jenkins is used to build and test your product continuously, so developers can continuously integrate changes into the build. Jenkins is the most popular open source CI/CD tool on the market today and is used in support of DevOps, alongside other cloud native tools.
This section demonstrates how Developer Hub allows you to instantiate a Quarkus application that is built using a Jenkins pipeline as well incorporating all aspects of RHTAP.
Run the template
-
Login to developer hub and on the left menu click Create
-
Search for a template called Securing a Quarkus Service Software Supply Chain (Jenkins)
-
Once you find it, click on Choose
-
On the Provide Information for Application page, you may update the maven properties as you prefer or you can leave the defaults.
-
On the Provide Image Registry Information, select Quay
-
On the Application repository Information, you can enable commit signing if you wish or you can continue with the default values.
-
Click on create. This should create the application repository, gitops repository and developer hub catalog item.
-
Click on Open software component
-
Click on the CI tab. There should be 3 projects visible, one for build, one for preparing a pre-prod deployment and one for preparing a prod deployment. A build should automatically trigger. If this does not show up, click on a different tab and then click back to the CI tab to refresh the page.
-
You may click on the View build icon to view the output of the build on jenkins. Enter the credentials provided on the demo landing page.
-
Once the build is complete, click on the Topology tab. The application for dev is now healthy, indicated by a blue ring. Click on the arrow on the application icon to view the Quarkus application.
-
To make changes to the Quarkus application, click on the Overview tab and select the OpenShift Dev Spaces (VS Code) link. This should provision a DevSpaces project where you can update the source code as you wish. Pushing the changes back to GitLab triggers a new build and deploy to dev.
Promote to preprod
-
To deploy your Quarkus application to preprod, switch to the Overview tab and click on the Source Code link. This should open the repository root on GitLab.
-
On the left menu, select Code and then Tags.
-
Click on New Tag
-
Give the tag a name such as
v1.0
-
Click on Create tag
-
Switch back to Developer Hub and click on the CI tab. A new preprod build will be triggered.
-
Click on the View build icon to view the output of the preprod build.
-
Wait for the build to complete and then click on the Topology tab. The application for preprod is now healthy, indicated by a blue ring. Click on the arrow on the application icon to view the Quarkus application.
Promote to prod
-
To deploy your Quarkus application to prod, switch to the Overview switch back the GitLab screen.
-
On the left menu, select Code and then Tags.
-
In the list of tags displayed, find the tag you created on the previous step.
-
Click the Create release button found to the right of the tag.
-
Click on Create tag
-
Enter a Release title for e.g. Prod-v1.0
-
Switch back to Developer Hub and click on the CI tab. A new prod build will be triggered.
-
Click on the View build icon to view the output of the prod build.
-
-
Wait for the build to complete and then click on the Topology tab. The application for prod is now healthy, indicated by a blue ring. Click on the arrow on the application icon to view the Quarkus application.