pipeline {
agent any
stages {
stage("foo") {
steps {
script {
env.RELEASE_SCOPE = input message: 'User input required', ok: 'Release!',
parameters: [choice(name: 'RELEASE_SCOPE', choices: 'patch\nminor\nmajor',
description: 'What is the release scope?')]
}
echo "${env.RELEASE_SCOPE}"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,选择是硬编码的(补丁\nminor\nmajor)——我的要求是在下拉列表中动态给出选择值。我通过调用 api - Artifacts list (.zip) 文件名从 artifactory 中获取值在上面的示例中,它在我们进行构建时请求输入,但我想做一个“带参数的构建”
请对此提出建议/帮助。