-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathJenkinsfile-input
More file actions
81 lines (71 loc) · 2.74 KB
/
Jenkinsfile-input
File metadata and controls
81 lines (71 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
pipeline {
agent any
stages{
stage('simple'){
steps{
input message: 'Please input your name!', ok: 'Confirm',
parameters: [string(defaultValue: 'rick',
description: 'This should not be your real name.', name: 'name', trim: true)]
}
}
stage('complex'){
parallel {
stage('channel-1'){
steps{
input message: 'Please input your age!', ok: 'Confirm',
parameters: [string(defaultValue: '18',
description: 'Just a joke.', name: 'age', trim: true)]
}
}
stage('channel-2'){
steps{
input message: 'Please input your weight!', ok: 'Confirm',
parameters: [string(defaultValue: '50',
description: 'Just a joke.', name: 'weight', trim: true)]
}
}
}
}
stage('use result'){
parallel {
stage('one param'){
steps{
script{
result = input message: 'Please input the git branch name!', ok: 'Confirm',
parameters: [string(defaultValue: 'master',
description: 'The branch name of git repo', name: 'branchName', trim: true)]
git branch: result, url: 'https://github.com/devops-workspace/demo-junit'
}
}
}
stage('multi-param'){
steps{
script{
result = input message: 'Please input the git branch name with debug info!', ok: 'Confirm',
parameters: [string(defaultValue: 'master',
description: 'The branch name of git repo', name: 'branchName', trim: true),
string(defaultValue: 'debug info',
description: 'Output the debug info', name: 'debugInfo', trim: true)]
git branch: result.branchName, url: 'https://github.com/devops-workspace/demo-junit'
echo result.debugInfo
}
}
}
stage('param-boolean'){
steps{
script{
result = input message: 'Please input the git branch name with debug info!', ok: 'Confirm',
parameters: [string(defaultValue: 'master',
description: 'The branch name of git repo', name: 'branchName', trim: true),
string(defaultValue: 'debug info',
description: 'Output the debug info', name: 'debugInfo', trim: true),
booleanParam(defaultValue: false, description: 'Run this Pipeline in debug mode.', name: 'debug')]
git branch: result.branchName, url: 'https://github.com/devops-workspace/demo-junit'
echo result.debugInfo
}
}
}
}
}
}
}