How to trigger downstream jobs with Jenkins pipeline

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

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

  • @ФилипМихајлов
    @ФилипМихајлов 2 ปีที่แล้ว +2

    Great video man! I was looking for a downstream pipeline trigger and parametar sharing option for a whole day! Your work is appreciated!

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

    Most true helpful an information with awesome examples!

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

    Thanks for the Nice video. May I know how to set environment/global variables so that they can be used across stages. I have used environment {} for static. To create dynamic enviroment variables I want to clarify what is the best way to do it.

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

    Great explanation. Thanks for sharing your knowledge

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

      My pleasure!

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

    Thank you for saving my life! Appreciate your explanation!

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

      No problem.

  • @deji1010
    @deji1010 3 หลายเดือนก่อน

    Question please. Can you use Build step to trigger downstream job dynamically without listing the jobs?. Something like if a base image is built and published, the build step should dynamically trigger the downstream jobs that use that base image.

  • @anilkumar-rq1od
    @anilkumar-rq1od 4 ปีที่แล้ว

    Good video with simple example thank you👍👍

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

      Glad you liked it

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

    Hi..thanks for the video. Is it possible to send a user input as a parameter from one pipeline to other instead of predefined jenkins variable build number

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

      Yes it is. Use the input feature, create an environment variable and send it in the parameter section to the other side.

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

      Go to the input section here www.jenkins.io/doc/book/pipeline/syntax/ take a look how you can catch the value and that value here, can be send to the other jenkins job as a parameter too. 😊

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

    Hey, Thank you for the video. It's really nice
    I want downstream job to be triggered only when my upstream in successful, can we do that ?

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

      Yes you can.

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

      You have to use the variables result and ask for == SUCCESS and not Null. Sometimes the job doesn't fail and the result variable is null.

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

    could you post starter and release jobs groovy files please.

    • @DevBObs
      @DevBObs  9 หลายเดือนก่อน

      Sorry for delayed answer. Could you elaborate more so I can try to help?

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

    Hi, I'm wondering if it is possible to tigger another pipeline job on different Jenkins pod?

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

      Yes, absolutely

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

    Sir,Thanks for this video.This video helped me a lot.I just want to know one thing sir: If job-a fails then it should not trigger the job-b.Can you please help me how can i do that one.

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

      You can get the status of the job execution and ask for the status in the result variable.

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

      Example is
      ```
      def job_a = build job....
      job_a.getResult() ...//So you can handle your logic with this result
      ```

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

      @@DevBObs Thank You So Much for Replying to my msg sir

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

      Just let me know if you were able to solved. In other case, I will try to do a demo

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

      @@DevBObs Ok Sir,I will try & let u know the result

  • @Riddhi_Gupta.
    @Riddhi_Gupta. 3 ปีที่แล้ว

    option to change non blocking to blocking in jenkins while triggering downstream job from jenkins pipeline

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

    Thanks a lot mate

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

      Glad it helped

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

    Hello! I would like to know if i want to create a subproject on the page using pipeline script how do i do it? Because for freestyle projects the downstream projects will be shown on the page but not for pipeline and i am currently using pipeline and i want to display the downstream project! Looking forward to your reply :)

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

      You wont see it. It is a Jenkins ui design. The downstream jobs are going to be shown in the logs. 😉

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

      @@DevBObs oh thank you for replying!! Is it because it has to be triggered by an upstream project for the Subproject section to appear? This was what i read online about the plugin!

  • @Sri-mx7zj
    @Sri-mx7zj 4 ปีที่แล้ว

    can we get logs of down stream job as well ? and send an attachment

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

      You can send the logs from job-b, each job knows how to handle the logs.

  • @Jain.Sampada
    @Jain.Sampada 4 ปีที่แล้ว

    Is any plug-ins required for using that build job syntax?

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

      No Plugin is required to use that build job syntax.If you want to execute a job with parameters then you must to have install "Parameterized Trigger Plugin"

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

    May I know how to use job1 env variables in Job2?

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

      You can't but you can use parameters to send environment variables to job2

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

    Hi, Can you please help me on how can I attach my downstream job to my upstream pipeline
    Basically I want my pipeline (upstream job) should be integrated with the downstream job

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

      Hi. Sorry i didn't get the question. This is actually what i am doing in the job. The job excution can be anything. Is your downstream job a pipeline too or simply a job?

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

      @@DevBObs Basically my upstream job is triggering the downstream job and it ends there, from there my downstream job starts
      I want like my upstream should wait till the time my downstream job is completed

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

      @@ravipremani6201 ok got it. You can add an extra property to the job definition. After propagate you can add wait: true. That will wait until downstream job finished.

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

      @@ravipremani6201 please let me know whether that worked or not.

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

      @@DevBObs so when I kept the wait : true property it is waiting in the upstream job itself it is not going in the downstream job
      My upstream job takes max 2 seconds to complete

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

    I have been trying to run the following but it keeps throwing an error saying No item named /var/lib/jenkins/workspace/jenkins-script/jenkinsMain found
    build job: "/var/lib/jenkins/workspace/jenkins-script/jenkinsMain",
    parameters: [
    [ $class:'StringParameterValue',name: 'buildSteps',value: 'build/deploy']
    ]

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

      Hi, i am also facing same issue. Did you figured out how to resolve it?

    • @DevBObs
      @DevBObs  9 หลายเดือนก่อน

      I hope you both solve the issue. I was out for a while.