Jenkinsfile Beginner Tutorial 1 | What is Jenkinsfile | How to create jenkinsfile | Step by Step

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น •

  • @testingtrail
    @testingtrail 4 ปีที่แล้ว +6

    Thanks for explaining difference between scripted and declarative! You are the guy that best describes it. Looking forward for more to apply to my Cypress project!

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Awesome, thank you! Jorge

  • @dacepetersone2095
    @dacepetersone2095 2 ปีที่แล้ว +3

    Thank you, this was really for total beginners like me. Finally I managed with your tutorial.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome Dace

  • @matt-g-recovers
    @matt-g-recovers 3 ปีที่แล้ว

    Dude, your channel is fantastic for where I am in my career right now!
    How lucky am I to have found this channel?
    ...Man, ...thank you!

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Matt, great to know, can see this too - automationstepbystep.com/

  • @dronefilmsgermany
    @dronefilmsgermany 2 ปีที่แล้ว

    I am a total newbie from system administration background. the video was so clear and easy to understand.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      happy to know this

  • @vijayakanth308
    @vijayakanth308 4 ปีที่แล้ว +1

    I Fallen In Love With Your Tutorial Videos

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      I am so happy & humbled to know this Vijaya

  • @shashankchoubey4274
    @shashankchoubey4274 4 ปีที่แล้ว +1

    Great Raghav It's a Very interesting session . Please make more video on Jenkinsfile

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Next video coming soon Shashank

  • @shubhamprasad3213
    @shubhamprasad3213 4 ปีที่แล้ว +1

    I was waiting for Jenkins 🥺

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Jenkins Masterclass is coming soon

  • @rekhamalik3663
    @rekhamalik3663 2 ปีที่แล้ว

    Thank you for explaining in such a nice way!

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome Rekha

  • @hieunguyenofficial9497
    @hieunguyenofficial9497 3 ปีที่แล้ว

    I love your tutorial videos. Thanks.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      You are welcome Hieu

  • @nitishchauhan4256
    @nitishchauhan4256 3 หลายเดือนก่อน +1

    Very nice 👍

    • @RaghavPal
      @RaghavPal  3 หลายเดือนก่อน +1

      Thanks Nitish

  • @shafy7970
    @shafy7970 4 ปีที่แล้ว +1

    Love this ❤️❤️...keep on Rocking 👍👍

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks for watching

  • @shivamanand8998
    @shivamanand8998 2 ปีที่แล้ว

    Thank you this video was very helpful

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Glad it was helpful Shivam

  • @manishaverma81
    @manishaverma81 2 ปีที่แล้ว

    Thank You sir.. this is very helpful 👍

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome Manisha

  • @prashanth6848
    @prashanth6848 3 ปีที่แล้ว

    Great information. Thanks for sharing.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Glad it was helpful!

  • @suchishah8332
    @suchishah8332 2 ปีที่แล้ว

    Thank u for such nice explanation

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Most welcome Suchi

  • @bhaumik17able
    @bhaumik17able 4 ปีที่แล้ว +1

    Big fan of your teaching style Raghav sir. Awesome video and content. My question is that are you going to cover full jenkins video playlist?
    Thank you again

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Yes, a Masterclass on Jenkins is coming soon

  • @dilansomarathne9680
    @dilansomarathne9680 4 ปีที่แล้ว

    Great tutorial, Thanks!

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      You're welcome Dilan

  • @somanathmuduli4838
    @somanathmuduli4838 3 ปีที่แล้ว +1

    Hello sir
    Hope you doing well , i saw this series & one of my colleague suggest me . You are amazing. Your 2017 videos , And now this video is feels like you became a rocket & a expert one. Genius one
    @Raghav Pal

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Thanks a lot Somanath

  • @umangsingh6881
    @umangsingh6881 3 ปีที่แล้ว

    really amazing sir.

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Thanks a lot Umang

  • @devikabraj731
    @devikabraj731 3 ปีที่แล้ว

    superb topic

  • @hemanthp8587
    @hemanthp8587 2 ปีที่แล้ว +1

    i am about to start one of your jenkins playlist which is 6 years old. Is the concepts same now also when compared to 6 years old playlist.

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Hemanth, the basic structure and concepts are still the same, If you like can first do Jenkins Masterclass which is more recent - th-cam.com/video/woMAXn4e8NA/w-d-xo.html&vl=en

    • @hemanthp8587
      @hemanthp8587 2 ปีที่แล้ว

      @@RaghavPal Thanks raghav you have conveyed the topics in a great way

  • @rahulgupta-fp5vy
    @rahulgupta-fp5vy 3 ปีที่แล้ว

    big like for this video

  • @kenchattys6733
    @kenchattys6733 4 ปีที่แล้ว

    All your videos are very informative and easily understandable.. This makes all to understand topics nicely.. One question out of syllabus..
    Which camera and editing software u use ?

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      Hi Kenchatty, I used QuickTimePro and iMovies here

  • @gitikasurana843
    @gitikasurana843 ปีที่แล้ว

    Thanks, but I have one doubt, I have to trigger a job which is currently running on different build number and build number is defined as a parameter in a downstream job.
    So can you please help me on how to define the build number in the jenkinsfile ?

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      Hi Gitika,
      In Jenkins, you can trigger a downstream job and pass parameters using the build step in your Jenkinsfile. The build step takes a job name and an optional map of parameters, which can include the build number.
      Here is an example of how you can define the build number in your Jenkinsfile:
      pipeline {
      agent any
      stages {
      stage('Build') {
      steps {
      echo 'Building...'
      }
      }
      stage('Trigger Downstream Job') {
      steps {
      build job: 'DownstreamJobName', parameters: [
      string(name: 'BUILD_NUMBER', value: env.BUILD_NUMBER)
      ]
      }
      }
      }
      }
      In this example, the BUILD_NUMBER parameter is passed to the downstream job and its value is set to the env.BUILD_NUMBER environment variable, which contains the current build number.
      Note that the DownstreamJobName must be the name of the actual downstream job in Jenkins.
      You can also pass other parameters, such as strings or booleans, to the downstream job using the parameters map.

  • @jayantamandal9732
    @jayantamandal9732 4 ปีที่แล้ว +1

    Thanks a Lot Raghav for this session.Will the sh command in Jenkinsfile will work in windows machine eg: sh 'mvn clean install -Denv=qa'

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      on windows sh may not work

    • @amjads8971
      @amjads8971 4 ปีที่แล้ว +1

      Sh is not work in windows only mvn clean commands.
      Install gitbash and you should be able to use sh

  • @kavishautomationfactory170
    @kavishautomationfactory170 4 ปีที่แล้ว

    Thanks Ragahv.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Most welcome Kavish

  • @abhaypatel8722
    @abhaypatel8722 2 ปีที่แล้ว

    can you please explain how to create env variable in jenkin and assign its value from shell script and then use it in some other step , i am not able to assign its value in shell script

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Abhay, I will try to add a session, meanwhile can check online examples

  • @lifestylenounou3452
    @lifestylenounou3452 4 ปีที่แล้ว

    Thanks a lot, please if u can make a video about how automation works in radiostation, storage database request and configurations..

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      I will check if I can plan something on this

    • @lifestylenounou3452
      @lifestylenounou3452 4 ปีที่แล้ว

      @@RaghavPal thank you very much

  • @kubertrasad
    @kubertrasad 4 ปีที่แล้ว

    Thanks☺

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      You're welcome!

  • @vishwagowda875
    @vishwagowda875 2 ปีที่แล้ว

    Hi sir I need to create directory and clone the git repository inside the directory in the jenkins pipeline itself how to do that

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Vishwa, this can help - stackoverflow.com/questions/61146986/how-to-clone-a-github-repository-using-jenkins-pipeline-script
      I will plan to add a session when I get time

  • @JRiyaz
    @JRiyaz 4 ปีที่แล้ว

    I'm getting 'java.lang.IllegalArgumentException: Unsupported class file major version 59' exception. I've followed all the instructions as you said.

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Riyaz, what is the ver of java on your system, pls check. As of now Jenkins can work with Java 8 or 11

  • @amjads8971
    @amjads8971 4 ปีที่แล้ว

    Love it

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Thanks a lot

  • @swatzy20
    @swatzy20 3 ปีที่แล้ว

    Can you pls share a video on how to setup a windows slave node for Linux Jenkins master . If already present pls could you share the link

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว +1

      I will plan Swathish

  • @vipan16
    @vipan16 4 ปีที่แล้ว

    Can you please do the video with Azure dev ops since some companies required to have knowledge of devops . Moreover you can do everything on devops

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Sure Vipan, I will do

    • @vipan16
      @vipan16 4 ปีที่แล้ว

      @@RaghavPal Thank you and I appreciate your help !!

  • @75devendrasahu
    @75devendrasahu 4 ปีที่แล้ว

    Hello Sir,
    I don't know much about Jenkins, but want to learn.
    I have a case when I push some file on git and this trigger Jenkins job to deploy the same file to multiple servers(windows and Linux), thus this can be achieved by Jenkins? As per understanding Jenkins is CD tools that why I think to correlate the task.
    Please confirm I'm correlating right things?
    Thanks

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Yes, you can do Devendra, pls watch my Jenkins tutorials here - automationstepbystep.com/

    • @75devendrasahu
      @75devendrasahu 4 ปีที่แล้ว

      @@RaghavPal yes, I'm already watching TH-cam video this, does I go for Udemy tutorials as well ?
      Thanks

  • @sangeetham971
    @sangeetham971 4 ปีที่แล้ว

    Hi Raghav, I am having some issue with my Jenkins pipeline.Getting error as unable to find main class but In local.its running fine.can u pls help me

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Sangeetha, can you point in the video exactly where you are facing the issue, In case you are getting jenkinsfile from SCM, I will explain that in next video

    • @sangeetham971
      @sangeetham971 4 ปีที่แล้ว

      @@RaghavPal I am getting file not found exception config . properties. Do I need to write shell script for adding config file

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Hi Sangeetha, is this part of some project OR you are doing exactly as. per this video, In case you are just following this, let me know the time in the video where you are facing issues

  • @sanksars1313
    @sanksars1313 4 ปีที่แล้ว

    Pls put videos for Angular 10 and ReactJS

  • @samkamal7263
    @samkamal7263 3 ปีที่แล้ว

    Hi Raghav. When i tried to run the job for jmeter cmd from jenkin with Windows batch command, getting below error. can you please give your suggestion:
    " Building in workspace C:\Users\Sam\.jenkins\workspace\JmeterUserTest
    [JmeterUserTest] $ cmd /c call C:\Users\Sam\AppData\Local\Temp\jenkins6320711695279540982.bat
    The syntax of the command is incorrect."

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Sam, show me your command, check the syntax again

    • @samkamal7263
      @samkamal7263 3 ปีที่แล้ว

      @@RaghavPal I have used the below cmd
      D:\Jmeter\apache-jmeter-5.3\bin>
      -n -t D:\Jmeter\apache-jmeter-5.3\Project\UserReg\FirstTimeUserRegistration.jmx -l D:\Jmeter\apache-jmeter-5.3\Reports
      eport.jtl

    • @samkamal7263
      @samkamal7263 3 ปีที่แล้ว

      @@RaghavPal
      When tried command for Date, in console output i got the below message
      Started by user admin
      Running as SYSTEM
      Building in workspace C:\Users\Sam\.jenkins\workspace\testJob
      [testJob] $ cmd /c call C:\Users\Sam\AppData\Local\Temp\jenkins6322622250637004343.bat
      C:\Users\Sam\.jenkins\workspace\testJob>date
      The current date is: 07-02-2021
      Enter the new date: (dd-mm-yy)
      C:\Users\Sam\.jenkins\workspace\testJob>exit 1
      Build step 'Execute Windows batch command' marked build as failure
      Finished: FAILURE

    • @samkamal7263
      @samkamal7263 3 ปีที่แล้ว

      @@RaghavPal I have got build success in output console. Thanks for your time.

  • @raghavmalhotra3318
    @raghavmalhotra3318 3 ปีที่แล้ว

    Bro please help 🙏to complete my assignment
    "Install Jenkins on your laptop
    Install Mysql on your laptop
    Create a dummy DB (say testdb) and a Contact table with columns Firstname, Lastname, Phone, Mobile, email
    Write a Jenkins pipeline which takes an sql statement as a parameter like
    Insert statement into Contact table
    Add a new mysql DB user with password (this is at Mysql level and not in the Contact table)
    Alter table statement for adding address column to Contact table
    "
    This is my assignment and I easily install jenkin and mysql and I also create table in my sql but in 3rd step I don't know how I done this... please help

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Raghav, create a complete session may take time, but you will find helpful tutorials for your step. Can check automationstepbystep.com/

  • @lakshmananumanchipalli3557
    @lakshmananumanchipalli3557 2 ปีที่แล้ว

    Hi sir
    I need some help from you to fix my Jenkins issue.
    I tried to login Jenkins with my credentials..but it is throwing 401 error.
    It is showing welcome to Jenkins page. But showing invalid username and password.
    It's not the issue with the credentials. Even all my team also facing the same issue.
    What is the Root cause? How to fix this issue?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      Hi Lakshman, to reconfigure security options in the config.xml file. Check Jenkins config.xml file which holds all the information related to the security realm and the authorization strategy
      This file is located in the /var/lib/jenkins directory
      One thing you must know is that, by disabling the security any anonymous user can access your Jenkins

    • @lakshmananumanchipalli3557
      @lakshmananumanchipalli3557 2 ปีที่แล้ว

      @@RaghavPal I disabled the usesecurity. And now Jenkins is up and running. But I'm Jenkins pipelines are missing. Wat might be the cause?

    • @RaghavPal
      @RaghavPal  2 ปีที่แล้ว

      will need to check

  • @ramyas5152
    @ramyas5152 ปีที่แล้ว

    How to download Jenkins

    • @RaghavPal
      @RaghavPal  ปีที่แล้ว

      what OS are you using, Installation is explained in the video. Please let me know the exact issue in detail. Can also follow this - th-cam.com/video/woMAXn4e8NA/w-d-xo.html

  • @vimanthaperera3540
    @vimanthaperera3540 3 ปีที่แล้ว

    Hello Raghav! Thanks to you I have come this far in Jenkins. I have my pipeline script which contains two stages which are build one and build two respectively. I have an active choice parameter[1] which contains a single select choice list. In build 2 I have an active choice reference parameter[2] which refers the above mentioned active choice parameter[1]. From my build one stage it generates a test.txt file. As I have mentioned in my build two active choice reference parameter[2] I want to read the above text.txt file and return the values by using split(',') or tokensize(',') as a single select parameter.
    def fileContents = new File('C:/Users/Vimantha/Desktop/macAdds.properties').text.tokenize( "," )
    return fileContents
    I have used this inside the active choice reference parameter[2] script. But it gives me a error and doesn't execute. Can you help me with this? or is there any other way to do this?

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Hi Vimantha, will need to check the error and logs

    • @vimanthaperera3540
      @vimanthaperera3540 3 ปีที่แล้ว

      @@RaghavPal Is there any possible way to contact you?

    • @RaghavPal
      @RaghavPal  3 ปีที่แล้ว

      Commenting here is the best way

    • @vimanthaperera3540
      @vimanthaperera3540 3 ปีที่แล้ว

      pipeline {
      agent any
      parameters{
      string(name: 'IP_ADDRESS', defaultValue: '', description: 'Enter server IP address')
      string(name: 'USERNAME', defaultValue: '', description: '')
      string(name: 'PASSWORD', defaultValue: '', description: '')
      }
      environment{
      VERSION='1.3.0'

      }
      stages {
      stage('Build') {
      steps {
      echo 'Built'

      sh(script:"python sshMac.py ${IP_ADDRESS} ${USERNAME} ${PASSWORD}", returnStatus: true, returnStdout: true)
      }
      }
      stage('Test') {
      steps {
      script{

      env.FILENAME = readFile 'macAdds.properties'
      env.FILEDATA = FILENAME.tokenize( "," )

      input message: 'Please choose one',
      parameters: [
      [$class: 'ChoiceParameter',
      choiceType: 'PT_SINGLE_SELECT',
      description: 'Select the Environemnt from the Dropdown List',
      filterLength: 1,
      filterable: false,
      name: 'ENVIRONMENT',
      script: [$class: 'GroovyScript',
      fallbackScript: [
      classpath: [],
      sandbox: true,
      script: 'return ["ERROR"]'
      ],
      script: [
      classpath: [],
      sandbox: true,
      script: """

      return['1', '2', '3', '4']

      """.stripIndent()
      ]
      ]
      ],
      [$class: 'ChoiceParameter',
      choiceType: 'PT_SINGLE_SELECT',
      description: 'Select the Environemnt from the Dropdown List',
      filterLength: 1,
      filterable: false,
      name: 'ENVIRONMENT2',
      script: [$class: 'GroovyScript',
      fallbackScript: [
      classpath: [],
      sandbox: true,
      script: 'return ["ERROR"]'
      ],
      script: [
      classpath: [],
      sandbox: true,
      script: """

      return['1', '2', '3', '4', '5']

      """.stripIndent()
      ]
      ]
      ],
      [$class: 'CascadeChoiceParameter',
      choiceType: 'PT_SINGLE_SELECT',
      description: 'Select a choice',
      filterLength: 1,
      filterable: false,
      name: 'choice1',
      referencedParameters: 'ENVIRONMENT',
      script: [$class: 'GroovyScript',
      fallbackScript: [
      classpath: [],
      sandbox: true,
      script: 'return ["ERROR"]'
      ],
      script: [

      classpath: [],
      sandbox: true,
      script: """
      def tokens = ${FILENAME}.tokenize(',')
      switch(ENVIRONMENT) {
      case "1":
      return ${env.FILEDATA}
      case "2":
      return ${env.FILEDATA}
      case "3":
      return ${env.FILEDATA}
      case "4":
      return ${env.FILEDATA}
      }


      """
      ]
      ]
      ],
      text(name: 'vertical', defaultValue: "${FILENAME}")


      ]
      }
      echo 'Testing'
      echo "${FILENAME}"
      echo "${FILEDATA}"


      }
      }
      stage('Deploy') {
      steps {
      echo 'Deploying'

      }
      }

    • @vimanthaperera3540
      @vimanthaperera3540 3 ปีที่แล้ว

      Theres no error or logs it doesnt return any value for the switch case for FILEDATA. Moreover when I echo it (I have echod it under the switch case after the script) it gives me a perfect list. why it doesnt return the FILEDATA value in the script

  • @shashankchoubey4274
    @shashankchoubey4274 4 ปีที่แล้ว +1

    Great Raghav It's a Very interesting session . Please make more video on Jenkinsfile

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว +1

      I will do the next video soon

  • @BJDuncan
    @BJDuncan 4 ปีที่แล้ว

    Thank you. Great video 🙏

    • @RaghavPal
      @RaghavPal  4 ปีที่แล้ว

      Glad it was helpful!