How to configure Jenkins Stages Parallel vs Sequential
Vložit
- čas přidán 6. 09. 2024
- In this video, I explain how to configure the Jenkins stages for Parallel vs Sequential execution using declarative syntax. I also show an extra example of how to configure steps execution in parallel. I provide examples of when and how to use these approaches and what should be good practices in cases like theses.
I want to ssh multiple remote servers in parallel and perform some executions. How can I perform that in Jenkins?
I will recommend taking a look at Ansible. You can execute Ansible with Jenkins but if that is the main goal. The right tool will be Ansible and there are multiple reasons why you should do it that way rather than over-complicating your solution with just Jenkins.
how to run a specific stage on all nodes matching a label?
Great question. Same way you define an agent at root level, it is possible to do the same at stage level. Take a look at the documentation www.jenkins.io/doc/book/pipeline/syntax/#stage-level-agents
How to decide during runtime on which stages to run in parallel...for example I pass the stage names in build with parameters and those stages only should run in parallel...please help with the solution
You can create a share library and make decision based on parameters. Keep in mind you can run a specific pipeline based on your inputs. You define both but you decide when to run which one.