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.
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.
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
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. 😊
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.
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 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!
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"
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
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?
@@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
@@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 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
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'] ]
Great video man! I was looking for a downstream pipeline trigger and parametar sharing option for a whole day! Your work is appreciated!
Most true helpful an information with awesome examples!
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.
Great explanation. Thanks for sharing your knowledge
My pleasure!
Thank you for saving my life! Appreciate your explanation!
No problem.
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.
Good video with simple example thank you👍👍
Glad you liked it
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
Yes it is. Use the input feature, create an environment variable and send it in the parameter section to the other side.
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. 😊
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 ?
Yes you can.
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.
could you post starter and release jobs groovy files please.
Sorry for delayed answer. Could you elaborate more so I can try to help?
Hi, I'm wondering if it is possible to tigger another pipeline job on different Jenkins pod?
Yes, absolutely
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.
You can get the status of the job execution and ask for the status in the result variable.
Example is
```
def job_a = build job....
job_a.getResult() ...//So you can handle your logic with this result
```
@@DevBObs Thank You So Much for Replying to my msg sir
Just let me know if you were able to solved. In other case, I will try to do a demo
@@DevBObs Ok Sir,I will try & let u know the result
option to change non blocking to blocking in jenkins while triggering downstream job from jenkins pipeline
Thanks a lot mate
Glad it helped
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 :)
You wont see it. It is a Jenkins ui design. The downstream jobs are going to be shown in the logs. 😉
@@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!
can we get logs of down stream job as well ? and send an attachment
You can send the logs from job-b, each job knows how to handle the logs.
Is any plug-ins required for using that build job syntax?
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"
May I know how to use job1 env variables in Job2?
You can't but you can use parameters to send environment variables to job2
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
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?
@@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
@@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.
@@ravipremani6201 please let me know whether that worked or not.
@@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
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']
]
Hi, i am also facing same issue. Did you figured out how to resolve it?
I hope you both solve the issue. I was out for a while.