Jenkins

Jenkins - Continuous Deployment

Jenkins - Continuous Deployment

Jenkins is an excellent tool for offering continuous deployment and delivery. If you look at the flow of any software development from development to deployment, it will look like this.


The primary goal of continuous deployment is to automate the entire procedure depicted above. Jenkins accomplishes all of this through numerous plugins, one of which is the "Deploy to container Plugin," which was seen in previous courses.


Some plugins can provide a graphical depiction of the Continuous deployment process. But first, let's make another project in Jenkins to check how this works best.

Let's make a simple project that simulates the QA step and tests the Helloworld application.

Step 1 − Click on ‘New Item’ on the Jenkins dashboard. Choose a ‘Freestyle project’ and enter the name of the project as ‘QA’. Click ‘Ok’ to create the project.


Step 2 − In this example, we're keeping things simple by executing a test program for the Helloworld application.



So our project QA is now in place. You can run a build to see if it is working correctly.



Step 3 – Scroll to Helloworld project, click ‘Configure’



Step 4 − In the configuration screen, choose ‘Add post-build action’ and ‘Build other projects’


Step 5 − Enter QA as the project name to build in the 'Project to build' box. You can keep the option 'Trigger only if the build is stable' as the default. Save the file by clicking the Save button.


Step 6 − Build the Helloworld project. Now if you view the Console output, you will also see that when the Helloworld project is successfully constructed, the build of the QA project will also happen.


Step 6 − Build the Helloworld project. Now if you view the Console output, you will also see that when the Helloworld project is successfully constructed, the build of the QA project will also happen.


Step 7 – To now install the ‘Delivery pipeline plugin’. 

Go to Manage Jenkins, then ‘Manage Plugin’. On the tab ‘Available’, search for ‘Delivery Pipeline Plugin’. 

Click On ‘Install without Restart’. Restart the Jenkins..


Step 8 − In the Jenkins Dashboard, click on the symbol in the Tab adjacent to the 'All' Tab to see the Delivery pipeline in action.


Step 9 − Enter a name for View and choose ‘Delivery Pipeline View’.


Step 10 − You can leave the default options on the following screen. The following options can be modified:

• Check the box next to 'Show static analysis findings.'

• Check the box next to 'Show total build time.'

• For the first job, enter the Helloworld project as the first job to build.

• Give the Pipeline whatever name you like.

• Press the OK button.


You can now see a view of the complete delivery pipeline and each project's status in the pipeline.


The build pipeline plugin is another well-known plugin. Let's take a closer look at this.

Step 1 Navigate to Manage Jenkins Plugins. Look for 'Build Pipeline Plugin' in the ‘Available’ tab. Select Install without Restart. Restart the Jenkins instance once you've finished.


Step 2 − Click on the ‘ ’ symbol in the Tab next to the ‘All’ Tab to see the ‘Build pipeline’ in action, on the Jenkins Dashboard,


Step 3 − Enter a ‘View name’ name and choose ‘Build Pipeline View’.


Step 4 − Accept the default options, but be sure to enter the name of the Helloworld project in the Selected Initial job. Then, press the Ok button.


You will now see a good view of the complete delivery pipeline and each project status that is there in the pipeline.