Perform Continuous Deployment using Jenkins

Last updated on May 28 2022
Uma Kulkarni

Table of Contents

Perform Continuous Deployment using Jenkins

Jenkins – Continuous Deployment

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.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

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 within the earlier lessons.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

There are plugins available which can actually give you a graphical representation of the Continuous deployment process. But first lets 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.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 2 − In this example, we are keeping it simple and just using this project to execute a test program for the Helloworld application.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

So our project QA is now setup. You can do a build to see if it builds properly.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 3 − Now go to you Helloworld project and click on the Configure option

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

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

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 5 − Within the ‘Project to build’ section, enter QA as the project name to build. You can leave the option as default of ‘Trigger only if build is stable’. Click on the Save button.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 6 − Build the Helloworld project. Now if you see the Console output, you’ll also see that after the Helloworld project is successfully built, the build of the QA project will also happen.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 7 − Let now install the Delivery pipeline plugin. Go to Manage Jenkins → Manage Plugin’s. Within the available tab, search for ‘Delivery Pipeline Plugin’. Click On Install without Restart. Once done, restart the Jenkins instance.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 8 − To see the Delivery pipeline in action, within the Jenkins Dashboard, click on the + symbol within the Tab next to the ‘All’ Tab.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 9 − Enter any name for the View name and choose the option ‘Delivery Pipeline View’.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 10 − Within the next screen, you can leave the default options. One can change the subsequent 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.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

You’ll now see a great view of the entire delivery pipeline and you’ll be able to see the status of each project within the entire pipeline.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Another famous plugin is the build pipeline plugin. Let’s take a look at this.

Step 1 − Go to Manage Jenkins → Manage Plugin’s. Within the available tab, search for ‘Build Pipeline Plugin’. Click On Install without Restart. Once done, restart the Jenkins instance.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 2 − To see the Build pipeline in action, within the Jenkins Dashboard, click on the + symbol within the Tab next to the ‘All’ Tab.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 3 − Enter any name for the View name and choose the option ‘Build Pipeline View’.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

Step 4 − Accept the default settings, just within the Selected Initial job, ensure to enter the name of the Helloworld project. Click on the Ok button.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

You’ll now see a great view of the entire delivery pipeline and you’ll be able to see the status of each project within the entire pipeline.

Perform Continuous Deployment using Jenkins
Perform Continuous Deployment using Jenkins

So, this brings us to the end of blog. This Tecklearn ‘Perform Continuous Deployment using Jenkins’ blog helps you with commonly asked questions if you are looking out for a job in DevOps. If you wish to learn Jenkins and build a career in DevOps domain, then check out our interactive, Continuous Integration with Jenkins Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Continuous Integration with Jenkins

Continuous Integration with Jenkins Training

About the Course

Tecklearn has specially designed this Continuous Integration with Jenkins Training Course to advance your skills for a successful career in this domain. This course helps you learn server automation, continuous integration, build and configuration tools, Jenkins master-slave architecture, different types of plugins, implementing automated testing and more through hands-on projects and exercises. Upon completion of this online training, you will hold a solid understanding and hands-on experience with Jenkins.

Why Should you take Continuous Integration with Jenkins Training?

• Average salary of Jenkins Professional is $110k (Indeed.com Salary Data)
• Jenkins is an open-source automation server which enables developers around the world to reliably build, test, and deploy their software.

What you will Learn in this Course?

Introduction to DevOps

• What is Software Development
• Software Development Life Cycle
• Why DevOps?
• What is DevOps?
• DevOps Lifecycle
• DevOps Tools
• Benefits of DevOps
• How DevOps is related to Agile Delivery
• DevOps Implementation

Continuous Integration with Jenkins

• Introduction to Continuous Integration and Jenkins
• Jenkins Management
• Jenkins Master Slave Architecture
• Tools Required for CI
• Understanding CI/CD Pipelines
• Creating an end-to-end automated CI/CD Pipeline
• Jenkins Versions

0 responses on "Perform Continuous Deployment using Jenkins"

Leave a Message

Your email address will not be published. Required fields are marked *