Jenkins Pipeline: parallel and waitUntil, waiting until the other branch finishes
Posted by Admin • Monday, January 22. 2018 • Category: DevOpsLet's say that for the sake of speed, you are running two slow things in parallel, but you want one to wait for the other.
parallel one: {
node {
sh "sleep 15"
}
}, two: {
node {
//slow part:
sh "sleep 10"
// now do something that needs "one" to finish. There is a good chance that this will run too soon...
sh 'wget http://something' //for example
}
}
The problem, obviously, is that you can't be sure that the wget will run after part one finishes. (Let's assume that part one creates the file).
The is exactly what I'm lookin for! I'm going to try using this to ductape together sidecar containers in declarative pipelines I'm building in Jenkins.