Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Example from "alcohol" on Jenkins IRC 2019-07-02
- * Also mentioned https://devops.stackexchange.com/questions/986/how-to-build-a-complex-parallel-jenkins-pipeline
- */
- stage('update playgrounds') {
- String[] playgrounds = sh(
- script: "kubectl get namespace --selector playground/frontend=${branch} --output jsonpath='{.items[*].metadata.name}'",
- returnStdout: true
- ).trim().split()
- Map mapped = playgrounds.collectEntries { String namespace ->
- ["${namespace}": {
- stage ("update ${namespace}") {
- sh """
- bunch of commands to update a playground
- """.stripIndent()
- playgroundUpdated(namespace.replaceAll('playground-', ''), env.BRANCH_NAME, commit)
- }
- }]
- }
- mapped['failFast'] = true;
- parallel mapped
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement