Jenkins provides good support for providing continuous deployment and delivery. If you look at the flow of any software development through deployment, it will be as shown below.
The main part of Continuous deployment is to ensure that the entire process which is shown above is automated. Jenkins achieves all of this via various plugins, one of them being the âDeploy to container Pluginâ which was seen in the earlier lessons.
There are plugins available that can actually give you a graphical representation of the Continuous deployment process. But first, let’s create another project in Jenkins so that we can see best how this works.
Letâs create a simple project which emulates the QA stage, and does a test of the Helloworld application.
Step 1 â Go to the Jenkins dashboard and click on New Item. Choose a âFreestyle projectâ and enter the project name as âQAâ. Click on the Ok button to create the project.
Step 2 â In this example, we are keeping it simple and just using this project to execute a test program for the Helloworld application.
So our project QA is now set up. You can do a build to see if it builds properly.
Step 3Â â Now go to your Helloworld project and click on the Configure option
Step 4Â â In the project configuration, choose the âAdd post-build actionâ and choose âBuild other projects
Step 5Â â In the âProject to buildâ section, enter QA as the project name to build. You can leave the option as the default of âTrigger only if the build is stable. Click on the Save button.
Step 6 â Build the Helloworld project. Now if you see the Console output, you will also see that after the Helloworld project is successfully built, the build of the QA project will also happen.
Step 7Â â Let now install the Delivery pipeline plugin. Go to Manage Jenkins â Manage Plugin. In the Available tab, search for âDelivery Pipeline Pluginâ. Click On Install without Restart. Once done, restart the Jenkins instance.
Step 8 â To see the Delivery pipeline in action, in the Jenkins Dashboard, click on the + symbol in the Tab next to the âAllâ Tab.
Step 9 â Enter any name for the View name and choose the option âDelivery Pipeline Viewâ.
Step 10 â In the next screen, you can leave the default options. One can change the following settings â
- Ensure the option âShow static analysis resultsâ is checked.
- Ensure the option âShow total build timeâ is checked.
- For the Initial job â Enter the Helloworld project as the first job which should build.
- Enter any name for the Pipeline
- Click the OK button.
You will now see a great view of the entire delivery pipeline and you will be able to see the status of each project in the entire pipeline.
Another famous plugin is the build pipeline plugin. Letâs take a look at this.
Step 1Â â Go to Manage Jenkins â Manage Plugin. In the Available tab, search for âBuild Pipeline Pluginâ. Click On Install without Restart. Once done, restart the Jenkins instance.
Step 2 â To see the Build pipeline in action, in the Jenkins Dashboard, click on the + symbol in the Tab next to the âAllâ Tab.
Step 3 â Enter any name for the View name and choose the option âBuild Pipeline Viewâ.
Step 4 â Accept the default settings, just in the Selected Initial job, ensure to enter the name of the Helloworld project. Click on the Ok button.
You will now see a great view of the entire delivery pipeline and you will be able to see the status of each project in the entire pipeline.