<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Logesh Sakthivel</title>
    <description>The latest articles on DEV Community by Logesh Sakthivel (@logesh-sakthivel).</description>
    <link>https://dev.to/logesh-sakthivel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F904170%2F9a013599-8fdb-4b0c-b195-3c4661df6a4f.jpg</url>
      <title>DEV Community: Logesh Sakthivel</title>
      <link>https://dev.to/logesh-sakthivel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/logesh-sakthivel"/>
    <language>en</language>
    <item>
      <title>Jenkins Pipeline script from SCM</title>
      <dc:creator>Logesh Sakthivel</dc:creator>
      <pubDate>Fri, 01 Mar 2024 11:15:10 +0000</pubDate>
      <link>https://dev.to/logesh-sakthivel/jenkins-pipeline-script-from-scm-2k3k</link>
      <guid>https://dev.to/logesh-sakthivel/jenkins-pipeline-script-from-scm-2k3k</guid>
      <description>&lt;p&gt;&lt;em&gt;In the &lt;a href="https://dev.to/logesh-sakthivel/jenkins-pipeline-script-ggb"&gt;last article&lt;/a&gt;, we have seen how to write the pipeline script.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this article, we going to learn how to use the Pipeline script from SCM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisite&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jenkinsfile must be located in the SCM(Github,Bitbucket,…)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Create Pipeline Project
&lt;/h2&gt;

&lt;p&gt;In the Jenkins Dashboard, click on New Item to create new Pipeline Project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynpvmelj3wis0xo4mpol.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fynpvmelj3wis0xo4mpol.png" alt="Pipeline Project" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down to the Pipeline section. In the dropdown select the &lt;strong&gt;Pipeline script from SCM&lt;/strong&gt; option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc08z8veo1gptay24m4sf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc08z8veo1gptay24m4sf.png" alt="Pipeline script from SCM" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide the SCM - Git&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvrl4itzu13tzr3b1krx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvrl4itzu13tzr3b1krx.png" alt="Git" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Get the Repository URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftaj4501b3e3ue6veq5kj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftaj4501b3e3ue6veq5kj.png" alt="Repo URL" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credentials are not required since it is a Public repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0d23g0n2frr05pcduv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx0d23g0n2frr05pcduv7.png" alt="Add URL" width="644" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide the Branch details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiozwzb52uwk3qbkqsnsu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiozwzb52uwk3qbkqsnsu.png" alt="Branch details" width="447" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Provide the Script path(Jenkinsfile path)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2t056un2s7loo4s0viyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2t056un2s7loo4s0viyr.png" alt="Jenkins file" width="196" height="114"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my repo I have my Jenkinsfile in the root dir. So, the file name is good to go. If you have palced the file in some other folders please provide the exact path to the Jenkinsfile.&lt;/p&gt;

&lt;p&gt;Click Save.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Now
&lt;/h2&gt;

&lt;p&gt;Now build this project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxx99vsbg8840zhjl90sb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxx99vsbg8840zhjl90sb.png" alt="Build out" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check the logs for each stage in the Pipeline.&lt;/p&gt;




&lt;p&gt;In this article, we have learned how to use &lt;strong&gt;Pipeline script from SCM&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Happie Learning :)&lt;br&gt;
Keep Learning!!!&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Jenkins Pipeline script</title>
      <dc:creator>Logesh Sakthivel</dc:creator>
      <pubDate>Wed, 12 Jul 2023 15:03:50 +0000</pubDate>
      <link>https://dev.to/logesh-sakthivel/jenkins-pipeline-script-ggb</link>
      <guid>https://dev.to/logesh-sakthivel/jenkins-pipeline-script-ggb</guid>
      <description>&lt;p&gt;&lt;em&gt;In this article, we are going to write a simple Jenkins Pipeline script using some variables and functions that runs on the Agent we specify using the label.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The main goal of this article is to use variables,functions and agent labels in the Pipeline script. &lt;/p&gt;

&lt;p&gt;There are two ways of defining the Pipeline script in the Pipeline project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Directly writing the Script in the Pipeline section while creating the Pipeline Project.&lt;/li&gt;
&lt;li&gt;Pipeline Script from SCM (Source Code Management) using Jenkinsfile.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article we will be following the First way(Pipeline script).&lt;/p&gt;




&lt;h2&gt;
  
  
  Pipeline Script
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create Pipeline
&lt;/h3&gt;

&lt;p&gt;In the Jenkins Dashboard, click New Item and create a Pipeline Project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn2kt6f0yn80ap9bvmj67.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn2kt6f0yn80ap9bvmj67.png" alt="Create Pipeline"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down, in the Pipeline section we are going to write our Pipeline Script(&lt;a href="https://groovy-lang.org/" rel="noopener noreferrer"&gt;Groovy&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1k7f9m0s4j4ksa4wr1n2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1k7f9m0s4j4ksa4wr1n2.png" alt="Pipeline"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Pipeline Script
&lt;/h3&gt;

&lt;p&gt;Simple pipeline script that executes bash commands in the agent that I specified.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

pipeline {
    agent {
        label "ubuntu"
    }
environment {
        def myString = "Hello World"
        def myNumber = 10
        def myBool = true
    }
stages{
        stage("Node Info") {
            steps {
                echo "Node name $NODE_NAME and the labels: $NODE_LABELS"
            }
        }
        stage("Basic shell cmds") {
            steps {
                executeBasicShellCmds()
            }
        }
        stage("Variables") {
            steps {
                echo "myString: ${myString}"
                echo "myNumber: ${myNumber}"
                echo "myBool: ${myBool}"
            }
        }
    }
}
def executeBasicShellCmds(){
    sh """
    pwd
    ls -a
    uname
    whoami

    """
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  Pipeline Script breakdown
&lt;/h4&gt;

&lt;p&gt;All the pipeline related stuffs comes within the pipeline block. Fucntions will be written outside the pipeline block.&lt;/p&gt;

&lt;p&gt;To define a Pipeline,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

pipeline{
....
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To define variables,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

environment {
        def myString = "Hello World"
        def myNumber = 10
        def myBool = true
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To define the stages(Pipeline stages),&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

stages{
        stage("Stage 1") {
            steps {
                ...
            }
        }
        stage("Stage 2") {
            steps {
                ...
            }
        }
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The functions should be defined outside the pipeline block.&lt;br&gt;
To define a function with and without parameters,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

def func1(){
    echo "function 1"
}
def func2(String a){
    echo "${a}"
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pp9cv4vvbve7yfjw59y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pp9cv4vvbve7yfjw59y.png" alt="Pipeline script"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build Now&lt;/strong&gt;&lt;br&gt;
In the Project's page click on Build Now to build the Project.&lt;br&gt;
You can see the Build status on Stage view or in the Build history&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1mn3kipl67e86icz539.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1mn3kipl67e86icz539.png" alt="Build Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on the each stage to view the logs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyuo5lbigd80muwpy2ry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyuo5lbigd80muwpy2ry.png" alt="Stage 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwlo8vstxj6ttywnqfw4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwlo8vstxj6ttywnqfw4.png" alt="Stage 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5wogmtld2bwrcsbhyle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5wogmtld2bwrcsbhyle.png" alt="Stage 3"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;In this article, we have learned how to use the Pipeline script in the Pipeline project with the simple pipeline script.&lt;/p&gt;

&lt;p&gt;Happie Learning :)&lt;br&gt;
Keep Learning!!!&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>cicd</category>
      <category>pipeline</category>
    </item>
    <item>
      <title>Create Parameterized job in Jenkins</title>
      <dc:creator>Logesh Sakthivel</dc:creator>
      <pubDate>Wed, 07 Jun 2023 13:47:27 +0000</pubDate>
      <link>https://dev.to/logesh-sakthivel/create-parameterized-job-in-jenkins-47kc</link>
      <guid>https://dev.to/logesh-sakthivel/create-parameterized-job-in-jenkins-47kc</guid>
      <description>&lt;p&gt;&lt;em&gt;Some of our projects need parameters to be passed as an input while executing/building the Project. For that we can make our Project as parameterized.&lt;/em&gt;&lt;br&gt;
In this article we are going to create a Project in Jenkins that uses some input parameters.&lt;/p&gt;




&lt;h2&gt;
  
  
  Create Project
&lt;/h2&gt;

&lt;p&gt;Create a Freestyle Project in Jenkins.&lt;/p&gt;

&lt;p&gt;In the Project's Configuration page select the "&lt;strong&gt;This project is parameterized&lt;/strong&gt;" option. And add the Parameters.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BKi_Yt29--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1aq7z1smx2gdybpn69k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BKi_Yt29--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1aq7z1smx2gdybpn69k.png" alt="This project is parameterized" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I have added string parameter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---qGFQJxR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ilxfw8nmfpbjg4ofwg7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---qGFQJxR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ilxfw8nmfpbjg4ofwg7.png" alt="Add parameter" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also I have provided the "&lt;strong&gt;ubuntu&lt;/strong&gt;" as the label to execute this Project only on the machine that has the label "ubuntu".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EkBUjfpK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l88u7nado7ll6kb2ijp7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EkBUjfpK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l88u7nado7ll6kb2ijp7.png" alt="Execute" width="411" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the Build Section, I used Execute shell to print the &lt;strong&gt;executor_name&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--blvTcQzD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q65fnwnr99e6pyqi2w03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--blvTcQzD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q65fnwnr99e6pyqi2w03.png" alt="Execute shell" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Save.&lt;/p&gt;

&lt;p&gt;Parameterized_Project is created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hVSEpghl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lpbr25h5ixljn9a6vw1p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hVSEpghl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lpbr25h5ixljn9a6vw1p.png" alt="Parameterized_Project " width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Build with Parameters
&lt;/h2&gt;

&lt;p&gt;Now build this project by clicking the Build with Parameters.&lt;br&gt;
It prompts for the executor_name value with the default value as Logesh.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--reciKJX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ygzqjjnv6vc7oub93rv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--reciKJX4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ygzqjjnv6vc7oub93rv.png" alt="Build" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Build.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i05G_1mP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuqxzihdmr1cwmuj80dt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i05G_1mP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iuqxzihdmr1cwmuj80dt.png" alt="Console output" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;We can also add other types of parameters. Above, we have seen the string parameter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boolean Parameter
&lt;/h2&gt;

&lt;p&gt;In the same Project, goto configure and add an Boolean parameter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4SSL0rKM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dphgixpb1govpfk7d63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4SSL0rKM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dphgixpb1govpfk7d63.png" alt="Boolean Parameter" width="731" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By selecting the &lt;strong&gt;Set by Default&lt;/strong&gt; will make the default value as true. I need false as default value, so I left unchecked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w9She0ql--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4a5ht542g6qjx5uyy6q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w9She0ql--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4a5ht542g6qjx5uyy6q.png" alt="Execute shell" width="651" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build with Parameters&lt;/strong&gt;&lt;br&gt;
Now build this project by clicking the Build with Parameters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can see the default values
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tf0fh_iR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmwtj5a0gkiyd1h3k8vj.png" alt="Default values" width="726" height="422"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Provided values&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N0IvzYJ7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2r8v097w72dnvdvg8sc8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N0IvzYJ7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2r8v097w72dnvdvg8sc8.png" alt="Build" width="658" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click build.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VlypRwwR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u52514lwanpp35ufj6nt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VlypRwwR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u52514lwanpp35ufj6nt.png" alt="Console output" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Choice Parameter
&lt;/h2&gt;

&lt;p&gt;In the same Project, goto configure and add a &lt;em&gt;Choice parameter&lt;/em&gt;.&lt;br&gt;
Choice is like a Dropdown options, we can select any one from the given choices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C7KhVjNo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqq2o1so1rye6ntl2pwz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C7KhVjNo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqq2o1so1rye6ntl2pwz.png" alt="Choice Parameter" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Choice Parameter, the options should be written in line by line.&lt;br&gt;
Option in the First line is considered as the default value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wtjj0yZx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3j33b9ott56bcz2r4s31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wtjj0yZx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3j33b9ott56bcz2r4s31.png" alt="Execute shell" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build with parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now build this project by clicking the Build with Parameters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Default values&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EZVui26a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brusku63a83mrtekawtp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EZVui26a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brusku63a83mrtekawtp.png" alt="Default values" width="799" height="525"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Passed values&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2dU1Fqq8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7p8rszkcvat1o8zqy6p6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2dU1Fqq8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7p8rszkcvat1o8zqy6p6.png" alt="Provided values" width="698" height="539"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click build.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b_7rcorG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ajiaayapgygvfvndby1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b_7rcorG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ajiaayapgygvfvndby1.png" alt="Console output" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;In this article we have seen how to create a Parameterized project with String, Boolean and Choice parameters.&lt;/p&gt;

&lt;p&gt;Hope you have learned something new here.&lt;br&gt;
Happie Learning :)&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Build Jenkins job with Label</title>
      <dc:creator>Logesh Sakthivel</dc:creator>
      <pubDate>Tue, 06 Jun 2023 03:06:08 +0000</pubDate>
      <link>https://dev.to/logesh-sakthivel/build-jenkins-job-with-label-44ie</link>
      <guid>https://dev.to/logesh-sakthivel/build-jenkins-job-with-label-44ie</guid>
      <description>&lt;p&gt;&lt;em&gt;While building the Job we might want to run our Job only on specific machines (technically environments) for this we can use labels so that this Project (Job) runs only on the machine which has that label we specified.&lt;br&gt;
In this article, we are going to look how to create a Project(Job) that builds only on the machine that has the Label we specify.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;p&gt;We should have an Agent(Node) added to our Jenkins Controller. (if you want to setup one checkout my article &lt;a href="https://dev.to/logeshvel/adding-new-jenkins-nodeagent-3lij"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Project
&lt;/h2&gt;

&lt;p&gt;In the Jenkins Dashboard click &lt;strong&gt;New Item&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cKl-GADl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2te3ljt2k4atmf443j4l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cKl-GADl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2te3ljt2k4atmf443j4l.png" alt="New Item" width="511" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter the name for the New Item.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nICns2r---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yiyw97wr0uyjhglrdt4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nICns2r---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yiyw97wr0uyjhglrdt4v.png" alt="create Freestyle Project" width="800" height="443"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Give the description for the Project and select &lt;strong&gt;Restrict where this project can be run&lt;/strong&gt; checkbox and enter the Label of the machine where we need to run this Job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gre3Dtnc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88ped51vuvuzk3kzjmx8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gre3Dtnc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88ped51vuvuzk3kzjmx8.png" alt="label - ubuntu" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have an Ubuntu Node added to the Jenkins Controller with the label "&lt;strong&gt;ubuntu&lt;/strong&gt;". So, I made this project to run only on that machine by giving that label.&lt;br&gt;
Now scroll down and Add build step&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CUicUmiX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ou84t8kd0xwlh4m4x83j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CUicUmiX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ou84t8kd0xwlh4m4x83j.png" alt="Add build step" width="520" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have selected &lt;strong&gt;Execute shell&lt;/strong&gt; since I am gonna run this project in the Linux machine(Ubuntu).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ls7ezzc5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28d45cfh0maczgo8ik2b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ls7ezzc5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28d45cfh0maczgo8ik2b.png" alt="Execute shell" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pwd&lt;/strong&gt; - prints the current working dir&lt;br&gt;
&lt;strong&gt;uname&lt;/strong&gt; - gives the OS of the machine&lt;br&gt;
&lt;strong&gt;echo "Running this Project on ${NODE_NAME}"&lt;/strong&gt; - prints the Node name on which this project runs. &lt;br&gt;
&lt;strong&gt;echo "Lables of this node: ${NODE_LABELS}"&lt;/strong&gt; - prints the Labels of that node&lt;/p&gt;

&lt;p&gt;NODE_NAME , NODE_LABELS are Jenkins environmental variable.&lt;/p&gt;

&lt;p&gt;Click Save. Project is created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WOpjwH8x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32sbk4yai5jvdkrhmxkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WOpjwH8x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32sbk4yai5jvdkrhmxkl.png" alt="First project" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Project
&lt;/h2&gt;

&lt;p&gt;Inside the Project's page click &lt;strong&gt;Build Now&lt;/strong&gt; to build the project.&lt;br&gt;
Click on the Build Numbers in the Build History to see the Console Output of that build.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--O4eajYio--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pttdqmjjyq18a76d3qee.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--O4eajYio--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pttdqmjjyq18a76d3qee.png" alt="Console Output" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have successfully created a Project and restricted that project to run only on the machine that has the Label "ubuntu".&lt;/p&gt;




&lt;p&gt;Hope you have learned something new here.&lt;/p&gt;

&lt;p&gt;Happie Learning :)&lt;br&gt;
Keep Learning!!!&lt;/p&gt;

</description>
      <category>jenkins</category>
    </item>
    <item>
      <title>Adding new Jenkins Node(Agent)</title>
      <dc:creator>Logesh Sakthivel</dc:creator>
      <pubDate>Mon, 29 May 2023 14:31:53 +0000</pubDate>
      <link>https://dev.to/logesh-sakthivel/adding-new-jenkins-nodeagent-3lij</link>
      <guid>https://dev.to/logesh-sakthivel/adding-new-jenkins-nodeagent-3lij</guid>
      <description>&lt;p&gt;&lt;em&gt;The Jenkins architecture is designed for distributed build environments. It allows us to use different environments for each build project balancing the workload among multiple agents running jobs in parallel.&lt;br&gt;
The Jenkins controller is the original node in the Jenkins installation - jenkins.io&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;To build Jobs on the remote machine by Jenkins we need to add that machine as a Node(Agent) to our Jenkins Controller.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The agents require a Java installation and a network connection to the Jenkins controller.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this article we are going to learn how to add an Ubuntu machine as an agent to the Jenkins controller.&lt;/p&gt;

&lt;p&gt;I have installed Jenkins controller in my Windows machine. Ubuntu is installed on VMware Workstation (by Virtualization).&lt;/p&gt;

&lt;p&gt;Prerequisite to add my Ubuntu machine as a Jenkins Agent&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Network connection between the machine and the Jenkins controller&lt;/li&gt;
&lt;li&gt;Java installed on the machine (Agent)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Adding new Node
&lt;/h2&gt;

&lt;p&gt;In the Jenkins Dashboard, Manage Jenkins -&amp;gt; Manage nodes and clouds. Now you are in the Nodes page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fea29063cwx7n9374ibl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fea29063cwx7n9374ibl9.png" alt="Jenkins Dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxn6jazr70xm8nfy8o01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuxn6jazr70xm8nfy8o01.png" alt="Manage Jenkins"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrvynctmw8qqc6bfmjtq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgrvynctmw8qqc6bfmjtq.png" alt="Manage nodes and clouds"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can directly jump to this page from the Dashboard by clicking the Build Executor Status in the bottom left corner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvojhi3bp020uzsaynmhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvojhi3bp020uzsaynmhu.png" alt="Build Executor Status"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  New Node
&lt;/h2&gt;

&lt;p&gt;Okay. Now we are going to add node by clicking New Node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyaib4bakjfrea1lq6rk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyyaib4bakjfrea1lq6rk.png" alt="New Node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhslku9rtd8xs8wnw01pi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhslku9rtd8xs8wnw01pi.png" alt="create new node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw807g0n3lthqm5lu4uc0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw807g0n3lthqm5lu4uc0.png" alt="add details"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Number of executors&lt;/strong&gt; - this should be less than or equal to number CPUs or vCPUs of that machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Remote root directory&lt;/strong&gt; - An agent needs to have a directory dedicated to Jenkins. Specify the path to this directory on the agent. It is best to use an absolute path, such as /var/jenkins or c:\jenkins. This should be a path local to the agent machine. - from the help menu&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Labels &lt;/strong&gt;- Labels (or tags) are used to group multiple agents into one logical group.For example, if you have multiple Windows agents and you have a job that must run on Windows, then you could configure all your Windows agents to have the label windows, and then tie that job to this label.&lt;br&gt;
This would ensure that your job runs on one of your agents, but not on any agents without this label.Multiple labels must be separated by a space.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6l9no54qqb1pt37to7fr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6l9no54qqb1pt37to7fr.png" alt="My info"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v1bcdx5d6bgqmg4hx1b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0v1bcdx5d6bgqmg4hx1b.png" alt="Usage, Launch method"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Usage &lt;/strong&gt;- Controls how Jenkins schedules builds on this node. Two available options&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Use this node as much as possible. This option makes Jenkins to use this Node whenever possible. Ex: If a Job is triggered with the label "any "then the node which uses this option will aslo build that Job.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Only build jobs with label expressions matching this node&lt;br&gt;
This allows Jenkins to build the Job on this node that exactly matches the Label of this node.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Launch method&lt;/strong&gt; - This has 3 options.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Launch agent by connecting it to the controller&lt;/li&gt;
&lt;li&gt;Launch agent via execution of command on the controller&lt;/li&gt;
&lt;li&gt;Launch agents via SSH&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I will be using the 3rd option. For this SSH service needs to be enabled on the Ubuntu machine.&lt;br&gt;
To enable SSH on Ubuntu checkout my article &lt;a href="https://medium.com/@LogeshSakthivel/enable-ssh-on-ubuntu-708d20071a2e" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the Launch method I have used SSH. That asks &lt;br&gt;
&lt;strong&gt;Host&lt;/strong&gt;- hostname or IP of the machine&lt;br&gt;
&lt;strong&gt;Credentials&lt;/strong&gt;- Login creds (username/password)&lt;br&gt;
&lt;strong&gt;Host Key Verification Strategy&lt;/strong&gt; - since we are using SSH this asks how to verify the remote host key. I have used Manually trusted key Verification Strategy option. For this either we need to manually first verify the remote key before launching the Node else it will automatically verify at the time of launching. If we check this Require manual verification of initial connection checkbox then we must manually first verify the host key by manually connecting to it.&lt;br&gt;
&lt;em&gt;You can also explore the other "Host Key Verification Strategy" &lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tknpa08y9ntnc5ezhei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tknpa08y9ntnc5ezhei.png" alt="Availability,Node Properties"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Availability &lt;/strong&gt;- this decides when to start and stop the Agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have choosed "&lt;em&gt;Keep this agent online as much as possible&lt;/em&gt;".&lt;br&gt;
Save the details.&lt;br&gt;
In the Nodes page we could see our machine added as a Node&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq245j6jf3ibutpl6s29l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq245j6jf3ibutpl6s29l.png" alt="Nodes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select our Node.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iy88xxeq2qjgteabikq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iy88xxeq2qjgteabikq.png" alt="Our Node"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the connection log by clicking the Log tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmniuw5mzf9981n54oxgx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmniuw5mzf9981n54oxgx.png" alt="SSH connection log(automatically trusted)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above log we could see that the SSH key has been automatically trusted for connections to this machine because I haven't verified manually.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawh12q19m6opzt2csr8r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fawh12q19m6opzt2csr8r.png" alt="jenkins dir in our Ubuntu machine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image we could see that Jenkins Controller created the directory (we specified while adding the node) for the files related to Jenkins operations in the Node.&lt;/p&gt;

&lt;p&gt;Ubuntu machine is now added as an Jenkins Node (Agent).&lt;/p&gt;

&lt;p&gt;Happie Learning :)&lt;br&gt;
Keep Learning!!!&lt;/p&gt;

</description>
      <category>jenkins</category>
    </item>
  </channel>
</rss>
