Skip to content

Instantly share code, notes, and snippets.

@kisztof
Created January 13, 2020 07:42
Show Gist options
  • Save kisztof/22aefb3aae51b1d364e7963b1899aed8 to your computer and use it in GitHub Desktop.
Save kisztof/22aefb3aae51b1d364e7963b1899aed8 to your computer and use it in GitHub Desktop.
Jenkinsfile with depenedent stage on choosed agent from parameter
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