zan*_*man 0 jenkins jenkins-pipeline
我想用这个input步骤提示用户输入字符串,我在我的Jenkinsfile中使用了脚本管道,即顶层块是node而不是pipeline,但是当我把这input一步放在stage块中时,蓝海只是报告失败而不是提示我输入。
该input步骤是否仅支持声明性而不是脚本化?
代码如下:
node {
input {
message "Should we continue?"
ok "Yes, we should."
parameters {
string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
}
}
echo "Hello, ${PERSON}"
}
Run Code Online (Sandbox Code Playgroud)
Yes, the input step is absolutely supported in scripted pipelines, as this is really a step and not a construct of a declarative pipeline.
EDIT after OP posted the code:
You are trying to use the declarative syntax (input { .. }) within a scripted pipeline. Correct would be:
input(message: "Should we continue?")
Run Code Online (Sandbox Code Playgroud)
You find the documentation for the input step here.
| 归档时间: |
|
| 查看次数: |
3675 次 |
| 最近记录: |