{"id":20173,"date":"2020-10-11T12:39:28","date_gmt":"2020-10-11T07:09:28","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/"},"modified":"2025-01-06T19:27:43","modified_gmt":"2025-01-06T13:57:43","slug":"jenkins-tutorial","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/","title":{"rendered":"What is Jenkins, how to setup a Jenkins Pipeline?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction-to-jenkins\"><strong>Introduction to Jenkins<\/strong><\/h2>\n\n\n\n<p>Software\nDevelopment process isn\u2019t as simple as one might think, back in college I used\nto think software deployment was just a 3 step process \u2013 Create Code, Test\nCode, Run Code. Is this the workflow followed in actual development process?\nWell yes, but actually no. When I say yes I mean that Yes, this is the base on\nwhich a software development pipeline is created, so it does act as the basis\nbut it\u2019s not the same thing. Usually you would have a more intricate process in\nwhich you are developing the code, there are way more thing to think about than\njust creating, testing &amp; running. <\/p>\n\n\n\n<p>The software development process is such an intricate field that there are specific career fields in which people only concentrate on the pipeline itself rather than developing the code. This is where DevOps comes in, where it helps us to automate the whole process and make it as efficient as possible. DevOps has many phases within it, like Continuous Integration which helps us to continuously integrate all the parts of software development. And this is where Jenkins comes in, it is a continuous integration tool that helps us to integrate all the parts of software development process.<\/p>\n\n\n\n<p>All\nright, are you confused enough with the wall of text I just threw at you? Don\u2019t\nworry I\u2019ll tell you everything you need to know to understand Jenkins Tool in\nas detailed matter as possible. So Let\u2019s get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-devops\"><strong>What is DevOps?<\/strong><\/h2>\n\n\n\n<p>DevOps by definition is a mix of Developer and Operations. The Dev in the name coming from Developer and the ops coming from operations. As the name implies the DevOps field is something that bridges the gap between developer and operations teams. But if you ask me, DevOps is more than that, it is many things at the same time \u2013It is a culture, it is a mindset, it is a philosophy, it is methodology, it is a set of tools or you can say it may even be a mix of all of these things but the goal is always clear, it focuses on delivering a product and creating a healthy working environment where everyone can freely exchange ideas without being bogged down by silos that are present in traditional software development. So this is DevOps.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"there-are-5-phases-of-devops\"><strong>There are 5 Phases of DevOps<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Continuous Development<\/li>\n\n\n\n<li>Continuous Testing<\/li>\n\n\n\n<li>Continuous Integration<\/li>\n\n\n\n<li>Continuous Deployment<\/li>\n\n\n\n<li>Continuous Monitoring<\/li>\n<\/ul>\n\n\n\n<p>We will be focusing on\nContinuous Integration.<\/p>\n\n\n\n<p><strong>Read:<\/strong> <a href=\"https:\/\/www.mygreatlearning.com\/blog\/how-to-become-a-prompt-engineer\/\">How to Become a DevOps Engineer<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-continuous-integration\"><strong>What is Continuous Integration?<\/strong><\/h2>\n\n\n\n<p>Continuous\nintegration is a phase of devops in which we continuously integrate all the\ndifferent parts of the software development process, like development,\nbuilding, testing, staging, deployment, monitoring. It helps us to not only\nintegrate all of these parts together but it also helps us automate a lot of\nthe processes.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The benefits of continuous integration:<\/li>\n\n\n\n<li>Increases the quality of software produced<\/li>\n\n\n\n<li>Makes life easier for testers by allowing them to easy test the\nsoftware<\/li>\n\n\n\n<li>Reduces the amount deployment failures<\/li>\n\n\n\n<li>Automates the build process<\/li>\n\n\n\n<li>Increases the speed with which software is deployed<\/li>\n<\/ul>\n\n\n\n<p>We\ngenerally tend to use a tool for this phase and the candidates for this are:\nJenkins, teamcity, bamboo, gitlab, circleci, travisci, etc.<\/p>\n\n\n\n<p>Out\nof all of these options we will be focusing on Jenkins as it is our article\ntopic.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-jenkins\"><strong>What is Jenkins?<\/strong><\/h2>\n\n\n\n<p>Jenkins is an Open\nSource continuous integration tool written in java that allows us to automate\nthe software development process, making sure that there is minimum involvement\nfrom us. It integrates all the different parts of the development in one place,\nthis makes it easier to handle all the different parts of the software\ndevelopment process. <\/p>\n\n\n\n<p>For eg. If you wanted to automatically build your software from your gihtub repository, you can configure a job to clone the repo into a local workspace and then build that code using a build file like pom.xml and then you can save your artefact generated in an archive or directly send it for testing.<\/p>\n\n\n\n<p>Also, check out <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/jenkins-tutorial\" target=\"_blank\" rel=\"noreferrer noopener\">Jenkins Free Course.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"jenkins-history\"><strong>Jenkins History<\/strong><\/h2>\n\n\n\n<p>Jenkins was originally\ndeveloped under the name Hudson back in 2004 by the organisation sun\nmicrosystems. Slowly but surely Hudson started becoming popular with other\ncompanies and other people. <\/p>\n\n\n\n<p>When sun microsystems were\nbought over by oracle they kept the project but there were conflicts between\nthe community supporting Hudson and oracle. So it was decided that the tool\nwould be split into two; something oracle could call its own, \u201cHudson\u201d and \u201cJenkins\u201d\nwhich was to be a completely community driven project. Though both of them\noriginally shared similar source trees, the tools are now quite different and\nJenkins has become more popular than ever now. It is now one of the most used\nCI\/CD tools in the industry out there.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"benefits-of-jenkins\"><strong>Benefits of Jenkins<\/strong><\/h2>\n\n\n\n<p>There are a lot of benefits to using Jenkins such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Jenkins is a community driven tool, this means that\nthere is no corporate meddling and that Its open source and any one can use it\nwithout licensing it. This also means that it has a very very large community\nthat constantly contributes to it. Any time a new trendy tool comes along and\nyou can be assured that someone will make a plugin for it for Jenkins.<\/li>\n\n\n\n<li>Another benefit is that It\u2019s completely free, so you\ndon\u2019t have to pay a single penny for it, for any reason that you may use it\nfor. This makes it very attractive for those who do not wish to accrue anymore\nsubscription costs, like start-ups, small companies, individuals.<\/li>\n\n\n\n<li>Jenkins is a highly modifiable and adaptable tool. It has\na support for a very large number of plugins. Especially compared to its paid\ncompetitors such as bamboo, teamcity which only have only a limited number of\nsupportability for plugins.<\/li>\n\n\n\n<li>Jenkins can run on any major platform without any\ncompatibility issues. This makes it useful for inconsistent environments.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"jenkins-architecture\"><strong>Jenkins Architecture<\/strong><\/h2>\n\n\n\n<p>Jenkins is a continuous integration tool which means that it creates build jobs to perform multiple different tasks in different phases. To do this in an organization with multiple teams and multiple projects is difficult if you do so only using one server. It will lead to server overload more often than not, which will lead to bottlenecks in the software development process which is a big no no in our eyes. To make sure such a problem does not happen Jenkins divides all of the tasks it receives onto its slaves. So Jenkins makes use of a master slave architecture, where one Jenkins server is the master from where all the tasks are distributed onto the multiple slaves. You can call these slaves as also agents that execute tasks based on your configurations. If you want, you can specify which task should be executed on which slave or you can leave it up to the master to decide. It will decide this by checking which slave is idle or which slave has enough of a resource pool to execute the tasks. That\u2019s the Jenkins architecture.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"jenkins-case-study\"><strong>Jenkins Case Study<\/strong><\/h2>\n\n\n\n<p>Let\u2019s\nsee how a big company fared on choosing Jenkins as their CI\/CD tool.<\/p>\n\n\n\n<p>We\nwill be look at the example of the Large telecommunication company T-Mobile.\nT-Mobile is a very large service provider, now for the sake of it if you wanted\nto call it a telecommunications company you could but the thing is that they\nprovide a lot of different services such as; Mobile services, TV services, banking\nfacilities, On-Road assistance and many more and they do this in multiple\ncountry though their main market is the USA.<\/p>\n\n\n\n<p>They\nproduce a lot of software to supplement their services and products, for that\nthey need to maintain large number of developing teams and software development\ninfrastructure. How do they manage all of these services and the constant\nsoftware demand that comes with it? Surely they make use of some kind of\nbreakneck technology to do this? Well, they do it\u2019s called Jenkins.<\/p>\n\n\n\n<p>They\nuse Jenkins as their favored choice of continuous integration and pipelining\ntool. It allows them to handle, manage and deploy multiple project with ease\nand efficiency.<\/p>\n\n\n\n<p>They\nhave gone a step further and improved upon whatever Jenkins already provided\nthem by streamlining a lot of their processes and reducing unnecessary\ncomplexity such as by reducing the number of plugins from 200 to 4 and by\ncreating a super streamlined and optimized set of pipelines. This allows all of\ntheir developers to focus on what they are good at; development. They shifted\nfrom having multiple master Jenkins agents to a single that allows 10 teams to\nwork at a time.<\/p>\n\n\n\n<p>You\ncan see that using Jenkins has not only benefited the company but also its customers\nas they get top notch software quickly without any hassle. Jenkins is a very\nflexible tool that can be very carefully molded into what a company needs and\nfinds useful.<\/p>\n\n\n\n<p>Okay\nso now that we have understood what Jenkins is, what its history is, what it\u2019s\nbenefits are, how it works and what kind of impact it has had on certain\ncompanies we can now dive into installing it and using it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"jenkins-installation\"><strong>Jenkins Installation <\/strong><\/h2>\n\n\n\n<p>So\nyou can install Jenkins on a lot of different operating systems without a\nhitch, a few popular ones are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Linux \u2013 Ubuntu<\/li>\n\n\n\n<li>Windows<\/li>\n\n\n\n<li>Mac<\/li>\n<\/ul>\n\n\n\n<p>So\nhere in our tutorial for Jenkins we will be learning how to install Jenkins in\nUbuntu Linux distro, I will also be using the Ubuntu Linux VM available on AWS\n(cloud provider). (optional) I recommend you also use the Ubuntu Linux VM\navailable on AWS as we will need it later when we create multiple Jenkins nodes\nto create a master slave architecture.<\/p>\n\n\n\n<p>Now\nI\u2019ve kept it Ubuntu because of two reasons:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ubuntu is easy to use and even has a GUI if you are using your own system or VM.<\/li>\n\n\n\n<li>It will give you some exposure to using Jenkins on Linux, which is something you will see a lot in the industry.<\/li>\n<\/ul>\n\n\n\n<p>Here are the pre-requisites\nfor installing Jenkins on your Ubuntu OS:<\/p>\n\n\n\n<p><strong>Hardware\npre-requisites:<\/strong><\/p>\n\n\n\n<p>At the minimum you\nneed to have these requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>At least 500 MB of RAM<\/li>\n\n\n\n<li>At least 2GB of hard-drive space.<\/li>\n<\/ul>\n\n\n\n<p>But this is if you\nonly wish to practice with Jenkins, if your intention is to run it on your\nsystem for actual Continuous Integration Purpose then check the recommended\nsystem requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>At least 1GB of Ram<\/li>\n\n\n\n<li>At least 50 GB of Hard-drive Space.<\/li>\n<\/ul>\n\n\n\n<p><strong>Software\nPre-requisites:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A working web browser<\/li>\n\n\n\n<li>Java <\/li>\n<\/ul>\n\n\n\n<p>Alright, now that we\nare past the requirements let me tell you that I will be showing you how to\ninstall Jenkins in two ways; directly &amp; using Docker. If you are a beginner,\nI would recommend trying the default way.<\/p>\n\n\n\n<p>Directly installing\nJenkins in your system:<\/p>\n\n\n\n<p>First we will update\nour apt package manager<\/p>\n\n\n\n<p><code>$ sudo apt update<\/code><\/p>\n\n\n\n<p>Now, we will install\njava in Ubuntu:<\/p>\n\n\n\n<p><code>$ sudo apt install openjdk-8-jdk \u2013y<\/code><\/p>\n\n\n\n<p>To verify the java\ninstallation type in this command:<\/p>\n\n\n\n<p><code>$ java \u2013version<\/code><\/p>\n\n\n\n<p>Now we will go ahead\nand add the key to the Jenkins repository, without this we cannot install Jenkins.<\/p>\n\n\n\n<p><code>$ sudo wget -q -O - https:\/\/pkg.jenkins.io\/debian-stable\/jenkins.io.key | sudo apt-key add \u2013<\/code><\/p>\n\n\n\n<p>You should see a\nmessage saying \u201cOK\u201d<\/p>\n\n\n\n<p>Now we will setup the Jenkins\nrepository for the latest stable version using this command:<\/p>\n\n\n\n<p><code>$ sudo sh -c 'echo deb https:\/\/pkg.jenkins.io\/debian-stable binary\/ &gt; &nbsp; \/etc\/apt\/sources.list.d\/jenkins.list'<\/code><\/p>\n\n\n\n<p>This will add the\nJenkins URL directly to apt, so we can download it using apt.<\/p>\n\n\n\n<p>But after this we need\nto refresh the apt repositories again:<\/p>\n\n\n\n<p><code>$ sudo apt update <\/code><\/p>\n\n\n\n<p>Now we install Jenkins:<\/p>\n\n\n\n<p><code>$ sudo apt install jenkins \u2013y<\/code><\/p>\n\n\n\n<p>The process to install\nJenkins is as simple as that. J<\/p>\n\n\n\n<p>Now that we have\ncompleted the download of Jenkins using the direct method, let us now download\nit using Docker.<\/p>\n\n\n\n<p>Update your OS package\nmanager<\/p>\n\n\n\n<p><code>$ sudo apt update<\/code><\/p>\n\n\n\n<p>First install Docker\nin your system:<\/p>\n\n\n\n<p><code>$ sudo apt install docker.io \u2013y<\/code><\/p>\n\n\n\n<p>Now we will create a\nnetwork:<\/p>\n\n\n\n<p><code>$ sudo docker network create jenkins<\/code><\/p>\n\n\n\n<p>Now we will create two\nvolumes to store Jenkins data permanently and share the Docker TLS certificates\nfor connecting to it.<\/p>\n\n\n\n<p><code>$ sudo docker volume create jenkins-docker-certs<\/code><\/p>\n\n\n\n<p><code>$ sudo docker volume create jenkins-data<\/code><\/p>\n\n\n\n<p>We will be needing to run a few Docker commands in the Jenkins agents, to do this we need the help of something called docker:dind, so let\u2019s run a container for it using the below command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo docker container run \n  --name jenkins-docker \n  --rm \n  --detach \n  --privileged \n  --network jenkins \n  --network-alias docker \n  --env DOCKER_TLS_CERTDIR=\/certs \n  --volume jenkins-docker-certs:\/certs\/client \n  --volume jenkins-data:\/var\/jenkins_home \n  --publish 2376:2376 \n  docker:dind\n\n<\/pre><\/div>\n\n\n<p>Now we will run Jenkins itself in a container as such:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo docker container run \n  --name jenkins-blueocean \n  --rm \n  --detach \n  --network jenkins \n  --env DOCKER_HOST=tcp:\/\/docker:2376 \n  --env DOCKER_CERT_PATH=\/certs\/client \n  --env DOCKER_TLS_VERIFY=1 \n  --publish 8080:8080 \n  --publish 50000:50000 \n  --volume jenkins-data:\/var\/jenkins_home \n  --volume jenkins-docker-certs:\/certs\/client:ro \n  jenkinsci\/blueocean\n\n<\/pre><\/div>\n\n\n<p>So now, our\ninstallation for Jenkins using Docker is also completed.<\/p>\n\n\n\n<p>In both the cases;\ndirectly &amp; using Docker, you will be able to access Jenkins at the port\n8080 of either your localhost.<\/p>\n\n\n\n<p>For this go to any\nbrowser you have and type this in the navigation bar:<\/p>\n\n\n\n<p>Localhost:8080<\/p>\n\n\n\n<p>If you are doing the installation on a VM from a cloud service like AWS or Azure go to &lt;Your_VM_IP&gt;:8080.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"setup-configuration\"><strong>Setup &amp; Configuration<\/strong><\/h2>\n\n\n\n<p>Let\u2019s now set it up, once you access it at 8080, you should see this:<\/p>\n\n\n\n<p>This is security\nmeasure, copy the address and then come back to your terminal, <\/p>\n\n\n\n<p>Type in the following\ncommand if you directly installed Jenkins<\/p>\n\n\n\n<p><code>$ sudo cat \/var\/jenkins_home\/secrets\/initialAdminPassword<\/code><\/p>\n\n\n\n<p>If you are using\ndocker you need to first go into the docker container, do that using this\ncommand:<\/p>\n\n\n\n<p><code>$ sudo docker exec -it jenkins-blueocean bash<\/code><\/p>\n\n\n\n<p>Inside the container\nyou can use this command to get the initial password:<\/p>\n\n\n\n<p><code>$ cat \/var\/jenkins_home\/secrets\/initialAdminPassword<\/code><\/p>\n\n\n\n<p>Next you will be asked to customize Jenkins, I would recommend choosing install suggested plugins.<\/p>\n\n\n\n<p>It will install all of the suggested plugins and then will ask you to setup the admin.<\/p>\n\n\n\n<p>Enter all the relevant details and then click on Save and Continue:<\/p>\n\n\n\n<p>Leave the Jenkins URL as default.<\/p>\n\n\n\n<p>Click on Save and Finish.<\/p>\n\n\n\n<p>This is what your dashboard should somewhat look like.<\/p>\n\n\n\n<p>Here you can see a lot\nof different options to choose from, but you need only pay attention to these\nfor now: <strong>New Item, People, Build history<\/strong>\n&amp; <strong>Manage Jenkins<\/strong> on the left\nhand side and your profile on the right hand side.<\/p>\n\n\n\n<p>On clicking <strong>Manage Jenkins<\/strong> you will be able to view all of the different settings you can configure for Jenkins, such as Security, Configure system, global Tool config, Plugins, Node and Cloud management. <\/p>\n\n\n\n<p>Here you will also be able to view how well Jenkins is doing under Status information using a few tools available at your hand such as: system information, system log, about Jenkins, load statistics.<\/p>\n\n\n\n<p><strong>People<\/strong> shows you the list of users that can use the Jenkins server you have setup.<\/p>\n\n\n\n<p><strong>New item<\/strong> allows you to create\nJenkins objects such as: Freestyle Project, Pipeline, Multi-configuration\nProject, Multi-branch Pipeline, Folder, GitHub Organisation.<\/p>\n\n\n\n<p>And <strong>Build history<\/strong> lets you view the history of all the builds that have happened on your Jenkins server till date if not removed. As of right now this is what you should see when you click Build history:<\/p>\n\n\n\n<p>This is because we\nhave not started any build yet.<\/p>\n\n\n\n<p>So those were some important things within Jenkins that we will be working with today. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"master-slave-architecture-setup-optional\"><strong>Master Slave Architecture Setup [OPTIONAL]<\/strong><\/h2>\n\n\n\n<p>This next step is <strong>optional<\/strong>, if you do not wish to you can avoid this step. Now we will learn to setup a Master Slave Architecture for Jenkins, for this you will definitely need to make use of a cloud service such as AWS to launch multiple Instances.<\/p>\n\n\n\n<p>We will consider the current Jenkins server we have launched as our Jenkins Master Node, For the other two Slave Nodes we will launch two extra VM (so for this I would again recommend you use a Cloud provider for launching).<\/p>\n\n\n\n<p>Once you have launched the other two Virtual machine we can begin the\nsetup process,<\/p>\n\n\n\n<p>So first we need to configure these nodes within Jenkins itself, to do that you need to first head to configure global security in manage Jenkins.<\/p>\n\n\n\n<p>Now you need to change the TCP port inbound agents from disable to Random, this way they will have a random TCP port assigned to them for communication purposes.<\/p>\n\n\n\n<p>Next you need to go to manage nodes and cloud to add your slaves or agents<\/p>\n\n\n\n<p>Here click on new node to add a new node<\/p>\n\n\n\n<p>You will need to mention the name of the node and select permeant agent, then you can click on OK to do further configuration.<\/p>\n\n\n\n<p>Here, for now we only need to add the working directory path and the remote root directory, you can set these to <strong>\/home\/ubuntu\/Jenkins <\/strong>and then click on save.<\/p>\n\n\n\n<p>Now, do the same for Agent 2.<\/p>\n\n\n\n<p>So, once you have completed your configuration of the slaves on the master your node dashboard should look something like this:<\/p>\n\n\n\n<p>Click on Agent 1 and download the agent.jar file by clicking on it.<\/p>\n\n\n\n<p>You will need to copy the agent.jar file to your slave 1 and run the\ngiven command.<\/p>\n\n\n\n<p>To copy your agent.jar from your host system to your virtual machine you\ncan either make use of filezilla or you can use a very simple command.<\/p>\n\n\n\n<p>First locate where your agent.jar file has been downloaded on your host\nsystem. It should probably be in your downloads folder. Once you have located\nthe agent.jar file, open up powershell in the directory.<\/p>\n\n\n\n<p>Type in the following command to transfer the file from your host to the\nSlave 1:<\/p>\n\n\n\n<p><code>$ scp -i .\/&lt;PRIVATE_KEY&gt; agent.jar ubuntu@&lt;IP_OF_SLAVE_1&gt;:\/home\/ubuntu\/<\/code><\/p>\n\n\n\n<p>Make sure the private key you use to access the slave 1 is also in the\nsame folder.<\/p>\n\n\n\n<p>Alternatively, you can use git bash also if you want to transfer the\nfile using the same command.<\/p>\n\n\n\n<p>Now transfer the same file to your slave 2 as well, the only thing yuou\nhave to change here is the IP you are sending to.<\/p>\n\n\n\n<p><code>$ scp -i .\/&lt;PRIVATE_KEY&gt; agent.jar ubuntu@&lt;IP_OF_SLAVE_2&gt;:\/home\/ubuntu\/<\/code><\/p>\n\n\n\n<p>Make sure the private key you use to access the slave 2 is also in the\nsame folder.<\/p>\n\n\n\n<p>Your slaves do not need to have Jenkins installed on them, though you do\nneed java on them.<\/p>\n\n\n\n<p>You can install java on both of them using the command:<\/p>\n\n\n\n<p>$ sudo apt update &amp;&amp; sudo apt install -y openjdk-8-jdk<\/p>\n\n\n\n<p>Once you have transferred the file to both slave 1 &amp; slave 2 and you\nhave installed java on both of them you can go ahead and run the command given\nwithin each node. You can view this command by going <strong>to manage Jenkins -&gt; manage nodes and clouds -&gt; agent 1<\/strong> and &nbsp;<strong>manage\nJenkins -&gt; manage nodes and clouds -&gt; agent 2<\/strong> respectively.<\/p>\n\n\n\n<p>The commands should look something like this:<\/p>\n\n\n\n<p>Copy the command for agent 1 and then paste it in your slave 1, if you have followed the steps correctly you should see this as the output:<\/p>\n\n\n\n<p>Do the same for Slave 2, head to and <strong>manage Jenkins -&gt; manage nodes and clouds -&gt; agent 2 <\/strong>on your Jenkins, copy the command and paste it in your slave 2.<\/p>\n\n\n\n<p>Once, you do all of the above steps you should see that both of your agents are now connected as slaves. You can verify this in the node dashboard, it should look something like this:<\/p>\n\n\n\n<p>Congratulations! Now we will move ahead and create Jenkins build jobs and execute them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-does-jenkins-work\"><strong>How does Jenkins work?<\/strong><\/h2>\n\n\n\n<p>Jenkins allows you to create\nbuild Jobs. Build Jobs are processes that allow you configure a string of\nsoftware development processes that help you develop your software.<\/p>\n\n\n\n<p>e.g. If you wanted to\nautomatically test your code. You would create a job that detects new code\npushed to your repository and automatically triggers the cloning process and\nthen automatically starts running the test cases you had configured earlier to\nrun on the code.<\/p>\n\n\n\n<p>There are countless number\nof ways in which you can configure these build jobs. <\/p>\n\n\n\n<p>You can choose what\nkind of job you want too. Jenkins allows you choose from a set of different\nstyles of projects like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Freestyle Project \u2013 Allows you great\nconfigurability \/ flexibility and you can even run non software development\nprocesses with the help of this.<\/li>\n\n\n\n<li>Pipeline \u2013 Allows you to create a pipeline\nthat will execute a set of stages that can be configured to have a several set\nof commands within it. This is useful when you wish to create the software\ndevelopment pipeline. <\/li>\n\n\n\n<li>Multi-configuration Project \u2013 This is for\nthose project where you want to have a very large number of configurations that\nyou want to make to the software development process.<\/li>\n\n\n\n<li>Multi-branch Pipeline \u2013 This allows you to\ncreate multiple pipelines in conjunction with each other, it is useful when you\nhave a large set of projects that you want to develop, configure together and\ndeploy together.<\/li>\n\n\n\n<li>Folder \u2013 This just an object that allows\nyou to group other items together, allows you to organise all of your items\nunder user defined categories.<\/li>\n\n\n\n<li>GitHub Organisation- This allows you to\nscan a organisation\u2019s repository for all the software and markets for them.<\/li>\n<\/ul>\n\n\n\n<p>In this tutorial we will be learning about two of these items; Free-style jobs and Pipelines. So let\u2019s start of with Freestyle jobs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"jenkins-freestyle-job\"><strong>Jenkins Freestyle Job<\/strong><\/h2>\n\n\n\n<p>To create and item you have to select the type of item you wish to create, then give it a name and then click on<strong> OK. <\/strong>In our case it\u2019s going to be freestyle job and the name is going to be <\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-45.png\"><img decoding=\"async\" width=\"535\" height=\"333\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-45.png\" alt=\"\" class=\"wp-image-21411\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-45.png 535w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-45-300x187.png 300w\" sizes=\"(max-width: 535px) 100vw, 535px\" \/><\/figure>\n\n\n\n<p>As\nthe project opens up you will see that there are a lot of options from which\nyou can choose from and configure your project. There are several things to\nconfigure over hear such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>General<\/li>\n\n\n\n<li>Source\nCode Management<\/li>\n\n\n\n<li>Build\nTriggers<\/li>\n\n\n\n<li>Build\nEnvironment<\/li>\n\n\n\n<li>Build<\/li>\n\n\n\n<li>Post-build\nActions<\/li>\n<\/ul>\n\n\n\n<p><strong>General<\/strong><\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-46.png\"><img decoding=\"async\" width=\"624\" height=\"444\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-46.png\" alt=\"\" class=\"wp-image-21412\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-46.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-46-300x213.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-46-590x420.png 590w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-46-100x70.png 100w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Here I have entered a description, this is basically a meta description of what your project is about. Next, we will mention the github project URL from where we will be pulling code. This github URL will be to our project.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-47.png\"><img decoding=\"async\" width=\"624\" height=\"294\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-47.png\" alt=\"\" class=\"wp-image-21413\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-47.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-47-300x141.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>You guys can refer to\nsame piece of code if you want. Here is the URL: <a href=\"https:\/\/github.com\/remi-code\/simple-web-app.git\">https:\/\/github.com\/remi-code\/simple-web-app.git<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The next option we will configure is the \u201cRestrict where this project can be run\u201d option. Here, Enter the name of the Agent you had configured earlier, you will have to mention the name in double quotes as in the screenshot. <\/p>\n\n\n\n<p><strong>Source Code Management<\/strong><\/p>\n\n\n\n<p>Here, you can configure the type of source code manager you are using. Since we will be using git, git should be selected.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-48.png\"><img decoding=\"async\" width=\"624\" height=\"400\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-48.png\" alt=\"\" class=\"wp-image-21414\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-48.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-48-300x192.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>You can enter the same URL again. Under this type of configurability, you have a much wider range of settings you can changes, such as which branch you want the code cloned from. We will leave it as master as that\u2019s where our code is. You can also choose the credentials for the GitHub URL. In our case we don\u2019t need a set of credentials as my repo id public and open to all, hence it does not need any credentials.<\/p>\n\n\n\n<p><strong>Build Triggers<\/strong><\/p>\n\n\n\n<p>Under this category we will be configuring how our build job gets triggered. Now we can always manually start our build job, but the whole purpose of Jenkins is to automate processes, which means we need to reduce the amount of human intervention, to do this we need to trigger the build remotely, i.e. we need to start it when some other process ends. For our purpose we will be selecting<strong> \u201c<\/strong>GitHub hook trigger for GITScm polling<strong>\u201d<\/strong>, this will allow us to trigger our build job whenever we push code to our GitHub repository.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-49.png\"><img decoding=\"async\" width=\"624\" height=\"157\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-49.png\" alt=\"\" class=\"wp-image-21415\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-49.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-49-300x75.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><strong>Build Environment<\/strong><\/p>\n\n\n\n<p>This category allows us to our build\nenvironment. We will be selecting the \u201cDelete workspace before build starts\u201d,\nthis will clean up the workspace in the Jenkins server where this build job\nwill run, in our case \u201cAgent 1\u201d.<\/p>\n\n\n\n<p>We will also be selecting the \u201cAdd timestamps to the Console Output\u201d. This will let us know in the console which log was executed when.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-50.png\"><img decoding=\"async\" width=\"624\" height=\"199\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-50.png\" alt=\"\" class=\"wp-image-21416\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-50.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-50-300x96.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><strong>Build<\/strong><\/p>\n\n\n\n<p>Here you will be configuring what happens in the build itself.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-51.png\"><img decoding=\"async\" width=\"275\" height=\"212\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-51.png\" alt=\"\" class=\"wp-image-21417\"><\/figure>\n\n\n\n<p>Click on Add build step and choose Execute shell. We will be basically launching a HTML static web page in nginx using Docker. So Here is the list of commands we will be executing in our Jenkins execution shell.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\necho \u201cThis project is now building\u201d\nsudo apt update\nsudo apt install docker.io -y\nsudo docker build -t our_image . \nsudo docker run -it -d -p 80:80 --name my_container  our_image\n\n<\/pre><\/div>\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-52.png\"><img decoding=\"async\" width=\"624\" height=\"226\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-52.png\" alt=\"\" class=\"wp-image-21418\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-52.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-52-300x109.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>The code will be automatically cloned into the workspace. The Github also contains a dockerfile which will help us create our image. These steps will basically launch a docker container from the docker image we create out of our dockerfile. <\/p>\n\n\n\n<p><strong>Post-build Actions<\/strong><\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-53.png\"><img decoding=\"async\" width=\"255\" height=\"242\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-53.png\" alt=\"\" class=\"wp-image-21419\"><\/figure>\n\n\n\n<p>Here\nyou can add more configurations such as being notified when through email\nwhenever a job build goes wrong. For our purpose we will leave it be.<\/p>\n\n\n\n<p>Now\nyou can go ahead and click on save to save your project configurations.<\/p>\n\n\n\n<p>But\nbefore we execute the job there is however one more thing we need to do and\nthat is to make sure that our github url is pullable through a webhook.<\/p>\n\n\n\n<p>I would recommend forking this URL repository first for that purpose, you can do that by clicking on fork option given above in the URL location.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-54.png\"><img decoding=\"async\" width=\"413\" height=\"253\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-54.png\" alt=\"\" class=\"wp-image-21420\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-54.png 413w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-54-300x184.png 300w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/figure>\n\n\n\n<p>Once\nyou have forked the code over to you github account, you can configure it\naccordingly.<\/p>\n\n\n\n<p>Head to settings.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-55.png\"><img decoding=\"async\" width=\"624\" height=\"84\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-55.png\" alt=\"\" class=\"wp-image-21421\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-55.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-55-300x40.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Over Here you need to select Webhooks as your option of choice.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-56.png\"><img decoding=\"async\" width=\"367\" height=\"284\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-56.png\" alt=\"\" class=\"wp-image-21422\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-56.png 367w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-56-300x232.png 300w\" sizes=\"(max-width: 367px) 100vw, 367px\" \/><\/figure>\n\n\n\n<p>Select the add webhooks option to add a webhook.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-57.png\"><img decoding=\"async\" width=\"624\" height=\"107\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-57.png\" alt=\"\" class=\"wp-image-21423\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-57.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-57-300x51.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>The only thing you need to change over here is the payload URL<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-58.png\"><img decoding=\"async\" width=\"624\" height=\"244\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-58.png\" alt=\"\" class=\"wp-image-21424\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-58.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-58-300x117.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>You can copy it from\nbelow:<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttp:\/\/&lt;IP_of_master_jenkins&gt;:8080\/github-webhook\/\n<\/div><\/figure>\n\n\n\n<p>make sure to enter the\nIP of the Virtual Machine on which you launched the Jenkins Master Node.<\/p>\n\n\n\n<p>Then click on add\nwebhook to finish the process.<\/p>\n\n\n\n<p>Now you will have to verify if the webhook is working or not by looking at the webhook. If it shows a green tick mark, then your webhook is working.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-59.png\"><img decoding=\"async\" width=\"107\" height=\"54\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-59.png\" alt=\"\" class=\"wp-image-21425\"><\/figure>\n\n\n\n<p>Now you need to make\nsure that Jenkins on the agent 1 can make use of the sudo in the shell. To do\nthat you can go to the VM on which you have your Agent 1.<\/p>\n\n\n\n<p><code>sudo visudo<\/code><\/p>\n\n\n\n<p>Then go ahead and paste the following command in the file that opens up like so:<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-60.png\"><img decoding=\"async\" width=\"624\" height=\"65\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-60.png\" alt=\"\" class=\"wp-image-21426\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-60.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-60-300x31.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p><code>jenkins ALL=(ALL) NOPASSWD: ALL<\/code><\/p>\n\n\n\n<p>Save the file and come back to the Jenkins Freestyle project you created, you will see a lot of options such as:<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-61.png\"><img decoding=\"async\" width=\"477\" height=\"322\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-61.png\" alt=\"\" class=\"wp-image-21427\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-61.png 477w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-61-300x203.png 300w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/><\/figure>\n\n\n\n<p>Here you can click on\nBuild Now to start the job.<\/p>\n\n\n\n<p>Under the build history you can click on the glowing orb to see the console output.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-62.png\"><img decoding=\"async\" width=\"55\" height=\"40\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-62.png\" alt=\"\" class=\"wp-image-21428\"><\/figure>\n\n\n\n<p>You can see the console output; it will look a something like this:<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-63.png\"><img decoding=\"async\" width=\"397\" height=\"374\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-63.png\" alt=\"\" class=\"wp-image-21429\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-63.png 397w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-63-300x283.png 300w\" sizes=\"(max-width: 397px) 100vw, 397px\" \/><\/figure>\n\n\n\n<p> Now that our process has finished you can view it by going to IP address of the Slave - 1. You should see something like this: <\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-64.png\"><img decoding=\"async\" width=\"624\" height=\"142\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-64.png\" alt=\"\" class=\"wp-image-21430\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-64.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-64-300x68.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Now to see the github trigger work in action, clone the github URL in\nyour local system. <\/p>\n\n\n\n<p><code>$ git clone &lt;URL of the forked repo&gt;<\/code><\/p>\n\n\n\n<p>then make a change, and then stage the file.<\/p>\n\n\n\n<p><code>$ git stage .<\/code><\/p>\n\n\n\n<p>then go ahead and commit the file <\/p>\n\n\n\n<p><code>$ git commit -m \u201cmade changes\u201d<\/code><\/p>\n\n\n\n<p>before you push the code, go to your slave and remove the docker\ncontainer created during the process using this command:<\/p>\n\n\n\n<p><code>$ sudo docker rm -f $(sudo docker ps -a -q)<\/code><\/p>\n\n\n\n<p>then you can go ahead push the code back to your forked repo using the\nbelow command:<\/p>\n\n\n\n<p><code>$ git push origin master<\/code><\/p>\n\n\n\n<p>You should see this under the build history<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-65.png\"><img decoding=\"async\" width=\"286\" height=\"115\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-65.png\" alt=\"\" class=\"wp-image-21431\"><\/figure>\n\n\n\n<p>There! Now we learned how to create a freestyle Jenkins build job and\ntriggered it automatically using github webhook.<\/p>\n\n\n\n<p>Now let\u2019s move on to learn how to create a pipeline.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-ci-cd-pipeline\"><strong>What is a CI\/CD Pipeline?<\/strong><\/h2>\n\n\n\n<p>First, let\u2019s get to know what a pipeline is.<\/p>\n\n\n\n<p>A pipeline is a set of stages that define how the software is developed in different phases of the software development process. If you remember the software development life cycle, you will know that there are multiple parts to it such as: planning, designing, implementing, testing, staging, deploying, etc. These parts can be defined virtually in a pipeline as stages. Each stage serves a specific purpose and each stage will have a certain number of steps that help it achieve its goal.<\/p>\n\n\n\n<p>To know more about CI\/CD check out this <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/aws-ci-cd-pipeline-tutorial\" target=\"_blank\" rel=\"noreferrer noopener\">Aws Ci\/Cd Pipeline Tutorial<\/a>. <\/p>\n\n\n\n<p>So\nagain:<\/p>\n\n\n\n<p>Stage: A bigger block of unit that represents a stage of the software\ndevelopment process. It contains a set of steps to be executed. <\/p>\n\n\n\n<p>and<\/p>\n\n\n\n<p>Step: a defined task that get\u2019s executed in a specific stage.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-66.png\"><img decoding=\"async\" width=\"587\" height=\"200\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-66.png\" alt=\"\" class=\"wp-image-21432\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-66.png 587w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-66-300x102.png 300w\" sizes=\"(max-width: 587px) 100vw, 587px\" \/><\/figure>\n\n\n\n<p>This is what a\npipeline would generally look like. Now, this is a very simplified version, and\nit does not constitute the content of every pipeline ever, that will depend on\nyour requirements and the phases of software development you will choose to\nexecute.<\/p>\n\n\n\n<p>Jenkins allows us to create these pipelines, and a very simplified Jenkins pipeline might look something like this:<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-67.png\"><img decoding=\"async\" width=\"566\" height=\"248\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-67.png\" alt=\"\" class=\"wp-image-21433\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-67.png 566w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-67-300x131.png 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/><\/figure>\n\n\n\n<p>You can see over here\nthat the source code will be pushed along to a source code manager, from there\nit will be automatically be detected by Jenkins and it will trigger the\npipeline, this pipeline will consist of stages such as building, testing,\nstaging, deploying. <\/p>\n\n\n\n<p>Now to create a Jenkins pipeline you need to write a Jenkins file, these files basically describe the stages, the steps involved in the stages and all the other configurations that maybe necessary for the pipeline.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-jenkins-file\"><strong>What is a Jenkins File?<\/strong><\/h2>\n\n\n\n<p>Jenkins file is a text file in which we write the pipeline script. This script is used to configure the stages and steps of a Jenkins pipeline. This file is written in the groovy language. Here is an example of a Jenkins File:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pipeline {\n  stages {\n    stage(\u201cBuild\") {\n       steps {\n         echo \u201cWe are going to build our application in this stage\u201d          \n   }\n    stage(\u201cTest\") {\n       steps {\n         echo \u201cTests are going to be now executed\u201d\n   }\n      stage(\u201cDeploy\") {\n       steps {\n         echo \u201cSoftware is going to be deployed\u201d\n   } \n } \n}\n<\/code><\/pre>\n\n\n\n<p>As you can\nsee in the above example, we have set three stages: Build, Test, deploy with\nvery simple steps to be executed within them; echo statements that will print\nwhat happens in the stage.<\/p>\n\n\n\n<p>The Jenkins\nfile can either be directly written during the configuration of the Jenkins\npipeline item creation or you can mention the URL where you Jenkins pipeline\nscript is located and it will then scan for it in the URL and then pull the URL\nand then use the Jenkins pipeline script from there.<\/p>\n\n\n\n<p>So now, Let\u2019s go ahead and create our own Jenkins pipeline in Jenkins.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"jenkins-pipeline\"><strong>Jenkins Pipeline<\/strong><\/h2>\n\n\n\n<p>Go to new item and then click on pipeline and give it a suitable name as given below:<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-68.png\"><img decoding=\"async\" width=\"205\" height=\"217\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-68.png\" alt=\"\" class=\"wp-image-21434\"><\/figure>\n\n\n\n<p>Then click on OK.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Under general configurations we will just enter the description and add the Github project URL.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-69.png\"><img decoding=\"async\" width=\"563\" height=\"331\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-69.png\" alt=\"\" class=\"wp-image-21435\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-69.png 563w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-69-300x176.png 300w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/figure>\n\n\n\n<p>You can use the same URL you used for\nyour freestyle project.<\/p>\n\n\n\n<p>Under Build Triggers we will be selecting the \u201cGitHub hook trigger for GITScm polling\u201d option again. So this pipeline will be triggered whenever we push any new code to the repository.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-70.png\"><img decoding=\"async\" width=\"624\" height=\"212\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-70.png\" alt=\"\" class=\"wp-image-21436\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-70.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-70-300x102.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Next comes the pipeline where you will be writing the Jenkins pipeline script.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-71.png\"><img decoding=\"async\" width=\"574\" height=\"322\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-71.png\" alt=\"\" class=\"wp-image-21437\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-71.png 574w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-71-300x168.png 300w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><\/figure>\n\n\n\n<p>You have two options, you can either write the pipeline script over here as it is or you can click on the definition drop down and select pipeline from script option.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-72.png\"><img decoding=\"async\" width=\"624\" height=\"389\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-72.png\" alt=\"\" class=\"wp-image-21438\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-72.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-72-300x187.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>Here\nyou can paste in the URL where your Jenkins File is located. But since our file\nis located in our own repository we can just mention the same URL, if you have\nforked my repository mention your URL.<\/p>\n\n\n\n<p>There\nare some other configurations within here that you can choose such as what\nbranch we will be on, but I would recommend leaving them default for now.<\/p>\n\n\n\n<p>With\nthat done, click on save and save the Pipeline.<\/p>\n\n\n\n<p>Once you have save it you should see similar options to that you saw before.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-73.png\"><img decoding=\"async\" width=\"285\" height=\"323\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-73.png\" alt=\"\" class=\"wp-image-21439\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-73.png 285w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-73-265x300.png 265w\" sizes=\"(max-width: 285px) 100vw, 285px\" \/><\/figure>\n\n\n\n<p>You have some extra options such as full stage view, that lets you view the stages a s whole. Click on build view and once the processing gets completed you can see the logs for all the stages that have been completed.  <\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-74.png\"><img decoding=\"async\" width=\"624\" height=\"199\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-74.png\" alt=\"\" class=\"wp-image-21440\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-74.png 624w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-74-300x96.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure>\n\n\n\n<p>This is what your stages should\nbe looking like. Each should show your stages being executed. And once they are\ncompleted you can see the logs&nbsp; and their\nsuccess or failure.<\/p>\n\n\n\n<p>If you check the console logs you can see that the proces has been completed and your stages have been successfully executed.<\/p>\n\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-75.png\"><img decoding=\"async\" width=\"445\" height=\"496\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-75.png\" alt=\"\" class=\"wp-image-21441\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-75.png 445w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-75-269x300.png 269w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/image-75-377x420.png 377w\" sizes=\"(max-width: 445px) 100vw, 445px\" \/><\/figure>\n\n\n\n<p>So there you have it guys, we learned how to create a pipeline here, now you can go ahead and configure this however you want to, add more stages, add very specific stages, it\u2019s your canvas, do what you want or what you require, checkout any Great learning articles for extra help or you always have internet search god google at your fingertip, Use it liberally.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>So that was Jenkins, a beautiful tool\nthat helps us to automate a lot of our software development processes and\nconnect all the different phases together. It\u2019s completely free and has a very\nlarge community. You can use a lot of different plugin depending upon your\nneeds.<\/p>\n\n\n\n<p>Hope this article was your comprehensive introduction to Jenkins. Feel free to leave a comment if you have any doubts. And all the best! For free courses on programming and more, you can check out <a href=\"https:\/\/www.mygreatlearning.com\/academy\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Great Learning Academy (opens in a new tab)\">Great Learning Academy<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction to Jenkins Software Development process isn\u2019t as simple as one might think, back in college I used to think software deployment was just a 3 step process \u2013 Create Code, Test Code, Run Code. Is this the workflow followed in actual development process? Well yes, but actually no. When I say yes I mean [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":20620,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25860],"tags":[],"content_type":[],"class_list":["post-20173","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Jenkins Tutorial for Beginners<\/title>\n<meta name=\"description\" content=\"Jenkins Tutorial: Jenkins was originally developed under the name Hudson back in 2004 by the organisation sun microsystems. Know how to use it?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Jenkins, how to setup a Jenkins Pipeline?\" \/>\n<meta property=\"og:description\" content=\"Jenkins Tutorial: Jenkins was originally developed under the name Hudson back in 2004 by the organisation sun microsystems. Know how to use it?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-11T07:09:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-06T13:57:43+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"700\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"30 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"What is Jenkins, how to setup a Jenkins Pipeline?\",\"datePublished\":\"2020-10-11T07:09:28+00:00\",\"dateModified\":\"2025-01-06T13:57:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/\"},\"wordCount\":5374,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg\",\"articleSection\":[\"IT\\\/Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/\",\"name\":\"Jenkins Tutorial for Beginners\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg\",\"datePublished\":\"2020-10-11T07:09:28+00:00\",\"dateModified\":\"2025-01-06T13:57:43+00:00\",\"description\":\"Jenkins Tutorial: Jenkins was originally developed under the name Hudson back in 2004 by the organisation sun microsystems. Know how to use it?\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg\",\"width\":1000,\"height\":700,\"caption\":\"Jenkins Tutorial\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/jenkins-tutorial\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IT\\\/Software Development\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/software\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What is Jenkins, how to setup a Jenkins Pipeline?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Jenkins Tutorial for Beginners","description":"Jenkins Tutorial: Jenkins was originally developed under the name Hudson back in 2004 by the organisation sun microsystems. Know how to use it?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"What is Jenkins, how to setup a Jenkins Pipeline?","og_description":"Jenkins Tutorial: Jenkins was originally developed under the name Hudson back in 2004 by the organisation sun microsystems. Know how to use it?","og_url":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2020-10-11T07:09:28+00:00","article_modified_time":"2025-01-06T13:57:43+00:00","og_image":[{"width":1000,"height":700,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"30 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"What is Jenkins, how to setup a Jenkins Pipeline?","datePublished":"2020-10-11T07:09:28+00:00","dateModified":"2025-01-06T13:57:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/"},"wordCount":5374,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg","articleSection":["IT\/Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/","url":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/","name":"Jenkins Tutorial for Beginners","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg","datePublished":"2020-10-11T07:09:28+00:00","dateModified":"2025-01-06T13:57:43+00:00","description":"Jenkins Tutorial: Jenkins was originally developed under the name Hudson back in 2004 by the organisation sun microsystems. Know how to use it?","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg","width":1000,"height":700,"caption":"Jenkins Tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/jenkins-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"IT\/Software Development","item":"https:\/\/www.mygreatlearning.com\/blog\/software\/"},{"@type":"ListItem","position":3,"name":"What is Jenkins, how to setup a Jenkins Pipeline?"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",1000,700,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700-300x210.jpg",300,210,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700-768x538.jpg",768,538,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",1000,700,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",1000,700,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",1000,700,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",640,448,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",96,67,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/Blog-Feature-Jenkins-Tutorial-1000X700.jpg",150,105,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":2,"uagb_excerpt":"Introduction to Jenkins Software Development process isn\u2019t as simple as one might think, back in college I used to think software deployment was just a 3 step process \u2013 Create Code, Test Code, Run Code. Is this the workflow followed in actual development process? Well yes, but actually no. When I say yes I mean&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=20173"}],"version-history":[{"count":22,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20173\/revisions"}],"predecessor-version":[{"id":110001,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20173\/revisions\/110001"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/20620"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=20173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=20173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=20173"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=20173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}