My knowledge of groovy doesn't go very far beyond what little I know about Jenkinsfiles. I'm trying to figure out if it's possible to have a map defined in a Jenkinsfile that can then be applied in a "for loop" fashion.
I have these variables:
mymap = {
"k1": "v1"
"k2": "v2"
"k3": "v3"
}
I have a stage
in my Jenkinsfile that looks like this:
stage('Build Image') {
withCredentials([[<the credentials>]) {
sh "make build KEY={k1,k2,k3} VALUE='{v1,v2,v3}'"
}
Is there a way to make a Build Image
stage for each of the pairings in mymap
? I haven't had any luck with what I've tried.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…