{"id":40574,"date":"2016-09-21T23:07:04","date_gmt":"2016-09-21T17:37:04","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=40574"},"modified":"2024-01-02T17:44:34","modified_gmt":"2024-01-02T12:14:34","slug":"continuous-delivery-pipeline-jenkins-delivery-pipeline-view-plugin","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/continuous-delivery-pipeline-jenkins-delivery-pipeline-view-plugin\/","title":{"rendered":"Setting up Continuous-Delivery Pipeline using Jenkins\u2019 Delivery-Pipeline-View Plugin"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Jenkins is a widely used CI tool which helps <a title=\"devops developer\" href=\"http:\/\/www.tothenew.com\/devops-automation-consulting\">DevOps teams<\/a> in automating the multiple tasks. The use of Jenkins has widely increased over a period of time due to a rich set of functionalities which it provides in the form of plugins. Jenkins has plugins for automating almost everything at the infrastructure level. In this blog, I am going to explain the use of \u201cDelivery Pipeline View\u201d plugin of Jenkins by which we can setup complete <a title=\"continuous integration\" href=\"http:\/\/www.tothenew.com\/devops-chef-puppet-docker\">continuous delivery pipeline<\/a>.<\/span><\/p>\n<p><strong><strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/www.perfectomobile.com\/sites\/default\/files\/images\/partner\/logos\/jenkins-logo-3.png\" alt=\"Image result for jenkins\" width=\"504\" height=\"224\" \/><br \/>\n<\/strong><\/strong><\/p>\n<p><b>Continuous-Delivery <\/b><span style=\"font-weight: 400;\">is the process of automating the code delivery tasks from development to production environment consisting of version control management, deployment on each environment followed by automated testing and taking decisions based on the results of the previous step. If the test cases are passed, the code will be automatically moved to the subsequent environment without any manual intervention till its deployed on production environment followed by post-deployment tasks.<\/span><\/p>\n<p>In Jenkins, each job has a post-build step in which we can specify the downstream projects on the basis of the result of the current step. I\u2019ve made a following flow of the build pipeline for demonstration purpose:<br \/>\n<strong>1. Dev-Deployment<\/strong><br \/>\n<strong>2. Dev-Testing<\/strong><br \/>\n<strong>3. UAT-Deployment<\/strong><br \/>\n<strong>4. UAT-Testing<\/strong><br \/>\n<strong>5. Prod-Deployment<\/strong><br \/>\n<strong>6. Prod-Testing<\/strong><\/p>\n<p><b>Note: <\/b>Each step is an independent Jenkins job in itself. If at a\u00a0certain point, any of my steps fails, the pipeline will get stopped. Each step will be started only if the previous step has run successfully.<\/p>\n<p><strong>Deplo<\/strong><b>yment Scenario<br \/>\n<\/b>In deployment case, I will be deploying an index page on Nginx from the git branch of the same environment of my git repository. For, e.g.,\u00a0for dev.example.com, I will be deploying the index page from the dev branch of my git repository. It contains the text that \u201cThis is dev site.\u201d<\/p>\n<p><b>Testing Scenario<br \/>\n<\/b>In my testing scenario, I am just checking whether the deployed index page contains the environment name. For e.g., \u201cThis is dev site\u201d contains the word \u201cdev\u201d in it. Means the test case is passed. The same process is repeated for all the environments.You can define the test cases as per the requirements.<\/p>\n<p>Also, in each job, I\u2019ve specified what are the upstream and downstream projects to build for the specific job. For eg. dev-testing has a downstream project for uat-deployment and upstream project for dev-deployment. Each downstream project will be run if its upstream project has run successfully. The below snapshot is the configuration of dev-deployment job:<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40585\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/dev-depl1.png\" alt=\"dev-depl\" width=\"956\" height=\"226\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/dev-depl1.png 956w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/dev-depl1-300x70.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/dev-depl1-624x147.png 624w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><em>Image1: Post build action for downstream project<\/em><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-40582 aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/dev-testing.png\" alt=\"dev-testing\" width=\"263\" height=\"259\" \/><\/p>\n<p><em>Image2:\u00a0<\/em><span style=\"font-size: 1rem;\"><em>Upstream and downstream project for dev-testing<\/em><\/span><\/p>\n<p>For the view of the delivery pipeline, the required plugin is <b>Delivery Pipeline Plugin.\u00a0<\/b>Please make sure the plugin is installed:<strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40586\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/plugin1.png\" alt=\"plugin\" width=\"956\" height=\"107\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/plugin1.png 956w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/plugin1-300x33.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/plugin1-624x69.png 624w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><\/strong><em>Image3: Installed Plugin of Delivery Pipeline View<\/em><\/p>\n<p><strong>Below is my pipeline configuration:<br \/>\n<\/strong>In the pipeline configuration, we can define the endpoint jobs of the pipeline like in my case the initial job is dev-deployment and final job is prod-testing:<strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40587\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeline-config1.png\" alt=\"pipeline-config\" width=\"859\" height=\"615\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeline-config1.png 859w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeline-config1-300x214.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeline-config1-624x446.png 624w\" sizes=\"(max-width: 859px) 100vw, 859px\" \/><\/strong><em>Image4: Pipeline configuration<\/em><\/p>\n<p><b>Before Executing the Pipeline: <\/b>The status of my 3 sites (dev.example.com, uat.example.com, example.com) is as follows:<strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40588\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/before-dep1.png\" alt=\"before-dep\" width=\"1298\" height=\"608\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/before-dep1.png 1298w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/before-dep1-300x140.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/before-dep1-1024x479.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/before-dep1-624x292.png 624w\" sizes=\"(max-width: 1298px) 100vw, 1298px\" \/><\/strong><\/strong><em>Image5: The status of the sites<\/em><\/p>\n<p><b>Executing the Pipeline: <\/b>Click on the build icon to start building the pipeline process:<strong><strong>\u00a0<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40589\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipe11.png\" alt=\"pipe1\" width=\"1209\" height=\"399\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipe11.png 1209w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipe11-300x99.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipe11-1024x337.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipe11-624x205.png 624w\" sizes=\"(max-width: 1209px) 100vw, 1209px\" \/><\/strong><\/strong><em>Image6: Building the pipeline<\/em><\/p>\n<p><b>Note: <\/b>If something gets break during the\u00a0pipeline, the build pipeline gets aborted. For eg. in Image7, my build 9 is aborted at dev-testing due to failure of the test cases:<strong><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40590\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeview11.png\" alt=\"pipeview1\" width=\"1287\" height=\"419\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeview11.png 1287w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeview11-300x97.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeview11-1024x333.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/pipeview11-624x203.png 624w\" sizes=\"(max-width: 1287px) 100vw, 1287px\" \/><\/strong><\/strong><em>Image7: Failure of\u00a0pipeline<\/em><\/p>\n<p><b>After executing build-pipeline successfully:<\/b><strong><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-40591\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/deployment2.png\" alt=\"deployment\" width=\"1305\" height=\"474\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2016\/09\/deployment2.png 1305w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/deployment2-300x108.png 300w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/deployment2-1024x371.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2016\/09\/deployment2-624x226.png 624w\" sizes=\"(max-width: 1305px) 100vw, 1305px\" \/><\/strong><\/p>\n<p>The code has been successfully deployed on all the environments after proper testing.<br \/>\n<strong>So, Jenkins is a fantastic tool to automate all the DevOps process. <\/strong>In my next, blog I\u2019ll be demonstrating about some other Jenkins\u00a0plugins for automation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jenkins is a widely used CI tool which helps DevOps teams in automating the multiple tasks. The use of Jenkins has widely increased over a period of time due to a rich set of functionalities which it provides in the form of plugins. Jenkins has plugins for automating almost everything at the infrastructure level. In [&hellip;]<\/p>\n","protected":false},"author":170,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":20},"categories":[1174,2348,1],"tags":[4019,4017,4016,3270,2845,4015,4020,1682,4014,4018],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/40574"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/170"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=40574"}],"version-history":[{"count":1,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/40574\/revisions"}],"predecessor-version":[{"id":59832,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/40574\/revisions\/59832"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=40574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=40574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=40574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}