Hello everyone, I'm currently working with scripted (non-declarative) Jenkins pipelines, and I'm looking to implement a condition similar to the when directive found in declarative pipelines. I want to be able to conditionally execute certain stages based on specific variables or conditions. I'm particularly interested in having stages appear greyed out (indicating they were skipped) using a declarative-like method. Does anyone know the equivalent of when or a similar approach for handling this in a scripted pipeline? Thank you in advance for your help!
@maddin50002 ай бұрын
I was always wondering what the differences between both types are, and when I have to use which. I thought there are differences of commands that I can use. But if this is the only difference, then I don't need to worry anymore since they seem to be almost the same.
@candyxoxo284 ай бұрын
For scripted pipeline, how do you declare a particular agent ?
@SV-tc8cu2 жыл бұрын
Great video however the title is slightly confusing. This is just a one specific difference. Would be great to show examples where scripted pipeline should be used instead of declarative one
@Beautifull-day Жыл бұрын
Very helpful thank you
@danieletrabucco7615 Жыл бұрын
watching the video how did you create 1 pipeline by reading 2 jenkinsfiles in 2 different jobs?
@danieletrabucco7615 Жыл бұрын
I understand... you created a directory and inside the 2 jobs calling them 01-basic/Jenkinsfile-scripted and 01-basic/Jenkinsfile-declarative
@sunils21117 ай бұрын
nicely explained
@SaurabhBudhwani Жыл бұрын
Hi, what if we need to skip a middle stage in the declarative pipeline and run the other two stages, any solutions?
@shivamsaxena001 Жыл бұрын
then simply remove that stage script temporarily or comment it
@karthikreddy764010 ай бұрын
You can use a flag variable and wrap the code under the if (flag) {}.
@deathcoder2 жыл бұрын
is that the only difference?
@erics83622 жыл бұрын
Is this the only difference?
@oleksiihead2 жыл бұрын
here you can find a couple additional differences - kzbin.info/www/bejne/e5rCf55nadulq6c
@abdennajifiras19754 ай бұрын
o.e.j.s.handler.ContextHandler#setContextPath: Empty contextPath solitio nfor this errors when i systemctl start jenkins idont get answer and jenkins doesnt works