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" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you share the missing part?