Created
August 27, 2019 19:53
-
-
Save nocode99/fe39bc705d15d484e9bf9fd63ef29ae6 to your computer and use it in GitHub Desktop.
Jenkins Pipeline CPU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generateStage(imageName, DOCKER_BUILD_ARG, args...) { | |
return { | |
stage("Building ${imageName}") { | |
lock(resource: "docker_build_${env.NODE_NAME}_${DOCKER_BUILD_ARG}", inversePrecedence: false) { | |
// [...] | |
} | |
} | |
} | |
} | |
pipeline { | |
[...] | |
DOCKER_BUILD_NUM = new Date().getTime() % 6 | |
stages["${imageName}-build"] = generateStage(imageName, DOCKER_BUILD_NUM, ...) | |
} | |
} | |
parallel stages | |
[...] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://issues.jenkins-ci.org/browse/JENKINS-44085?focusedCommentId=346951&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-346951