jenkins input 框
node {
stage 'S1'
// Define an input step and capture the outcome from it.
def outcome = input id: 'Run-test-suites',
message: 'Workflow Configuration',
ok: 'Okay',
parameters: [
[
$class: 'BooleanParameterDefinition',
defaultValue: true,
name: 'Run test suites?',
description: 'A checkbox option'
],
[
$class: 'StringParameterDefinition',
defaultValue: "Hello",
name: 'Enter some text',
description: 'A text option'
],
[
$class: 'PasswordParameterDefinition',
defaultValue: "MyPasswd",
name: 'Enter a password',
description: 'A password option'
],
[
$class: 'ChoiceParameterDefinition', choices: 'Choice 1\nChoice 2\nChoice 3',
name: 'Take your pick',
description: 'A select box option'
]
]
stage 'S2'
// Echo the outcome values so they can be checked fro in the test. This will help
// verify that input submit/proceed worked properly.
echo "P1: ${outcome.get('Run test suites?')}"
echo "P2: ${outcome.get('Enter some text')}"
echo "P3: ${outcome.get('Enter a password')}"
echo "P4: ${outcome.get('Take your pick')}"
}
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步