Last active
April 1, 2023 15:30
-
-
Save wololock/7c747d09e5e75bee8518143e8174a647 to your computer and use it in GitHub Desktop.
Jenkins Pipeline with matrix used for parallel deployments
This file contains hidden or 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
pipeline { | |
agent any | |
stages { | |
stage("Deploy") { | |
matrix { | |
axes { | |
axis { | |
name "DEPLOY_ENVIRONMENT" | |
values "DEPLOY_DEV", "DEPLOY_STAGING", "DEPLOY_PROD" | |
} | |
} | |
stages { | |
stage("Deploy") { | |
when { | |
beforeAgent true | |
expression { | |
params[DEPLOY_ENVIRONMENT] == true | |
} | |
} | |
steps { | |
echo "Deploying to $DEPLOY_ENVIRONMENT" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Author
wololock
commented
Jun 24, 2020
Are the axis input checkboxes a BlueOcean thing? If I setup a similar pipeline in Jenkins, I don't get to select the axis values I want to use, it just runs the stages for every value.
@paul-uz That might be the Blue Ocean UI feature only, I haven't been using Jenkins for a while, so I can't tell you 100%.
@paul-uz That might be the Blue Ocean UI feature only, I haven't been using Jenkins for a while, so I can't tell you 100%.
I dreaded as much! I just want to have multi-configurable pipelines 😂
the script is missing the input parameter line
the script is missing the input parameter line
Can you share the missing part?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment