Tips and Tricks of Pipelines
How did this chapter come to be? I was basically just pasting here stuff during work. There are many subtle...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, Pencillr. Thanks for sharing very useful tips about pipeline in your article. Do you have any idea about getting all names of stage before they have been executed? I mean, how to get all the defined stages' name in the beginning of Jenkinfile?
Hi, thank you. I don't know of any way that would get you the name of the stages before the stages run, in the Jenkinsfile. Although you could do several things to have the stage names beforehand.
First, you could instantiate a list with the names of the stages at the beginning, and you could reference the elements of it at the stage declaration.
Thanks for your reply. I think I understand what you mean, a parameters{} block or a input method is feasible.
Is there a way to check the whether Build A is running or not, If Build A running
Build B should be wait until this Build A has to complete, and then Build B has to complete its build, the pipeline to check the Build A is in Build B.....
Hi Pencillr, Thanks alot for the post. I have one requirement where I have to trigger 2nd stage in pipeline at different time and date after the initial stage. Can you please help me if you have any suggestions?
Did you ever figure out how to trigger 2nd stage in pipeline?
I also have a requirement to trigger just a stage in Jenkinsfile pipeline. This stage should only run daily but all other stages triggered by a code push. Any ideas?
Have the same case, no luck so far.
Use what is known as a parameterized pipeline. You can set default environment variables for code runs.
when
you want to change the behavior of the pipeline stage you can modify the parameter. If you set the toggle parameter to false in the UI, or by calling the build via URL, it will now skip the first stage because it's not trueCalling via URL:
http://server/job/project/buildWithParameters?toggle=false
Hi, Pencillr!
Thanks a lot for your tips, it is really useful. I have two question:
Best regards.
for #1. you can do
for #2. Not sure you can do that unless you run sequentially
Hi Pencillr, Thanks for this post.
I have one question.
I understood the use of propagate: false but how to show the stage as fail/red when something is actually failed. My job is failed and shows as green and I don't want to go and click every time inside the stage result.
Hi Pencillr, I would like to trigger just a pipeline stage in Jenkinsfile. This stage should only run daily but all other stages triggered by a code push. Any ideas?
Great and very useful tips.
Thank you, Richard!!!