Created
January 13, 2020 07:42
-
-
Save kisztof/22aefb3aae51b1d364e7963b1899aed8 to your computer and use it in GitHub Desktop.
Jenkinsfile with depenedent stage on choosed agent from parameter
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 AGENT_LABEL = null | |
node('master'){ | |
stage('pre'){ | |
AGENT_LABEL = env.SLOT | |
} | |
} | |
pipeline { | |
agent none | |
parameters { | |
choice choices: ['Agent1', 'Agent2'], description: 'Some description ', name: 'SLOT' | |
} | |
stages { | |
stage('Stage on selected agent) { | |
agent { | |
label "${AGENT_LABEL}" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment