ait*_*iar 10 jenkins jenkins-pipeline
我们正在Jenkins中构建多个管道任务,以便在某些部署作业上更轻松.其中一个需要手动输入几个参数.为此,我们使用这样的输入步骤:
def userInput = input ( message : 'Select deployment versión and input deployment code:',
parameters: [[$class: 'TextParameterDefinition', defaultValue: '', description: 'Clarive code', name: 'code']] )
Run Code Online (Sandbox Code Playgroud)
这些参数是强制性的.我们没有在文档中找到任何会使TextParameterDefinition成为必需的属性.现在我们重新运行该步骤,直到所有参数都不为空,但解决方案对用户来说有点混乱.
是否有另一种方法来处理强制参数,以避免在循环上运行相同的步骤?
有一个插件可以做到这一点,但不再维护。
有一个未解决的错误来支持它。
与此同时,您可以检查您的参数是否存在,如果不存在,则抛出如下错误:
if (params.SomeParam == null) {
error("Build failed because of this and that..")
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2411 次 |
| 最近记录: |