-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
129 lines (125 loc) · 3.26 KB
/
Jenkinsfile
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// pipeline {
// agent any
//
// environment {
// ENV_URL='pipeline.google.com'
// SSH_CRED=credentials('SSH')
// }
//
// options {
// ansiColor('xterm')
// }
//
// // triggers {
// // pollSCM('*/2 * * * *')
// // }
//
// tools {
// maven 'maven-3.8.7'
// }
//
// parameters {
// string(name: 'PERSON', defaultValue: 'Mr Jenkins', description: 'Who should I say hello to?')
// text(name: 'BIOGRAPHY', defaultValue: '', description: 'Enter some information about the person')
// booleanParam(name: 'TOGGLE', defaultValue: true, description: 'Toggle this value')
// choice(name: 'CHOICE', choices: ['One', 'Two', 'Three'], description: 'Pick something')
// password(name: 'PASSWORD', defaultValue: 'SECRET', description: 'Enter a password')
// }
//
// stages {
//
// stage ('One') {
//
// when {
// environment name: 'CHOICE', value: 'One'
// }
//
// steps {
// addShortText background: '', borderColor: '', color: '', link: '', text: 'One'
// sh '''
// echo Hello1
// echo Hello2
// echo ENV_URL=${ENV_URL}
// mvn --version
// '''
// }
// }
//
// stage ('two') {
// environment {
// ENV_URL='stage.google.com'
// }
//
// tools {
// maven 'maven-3.6.0'
// }
//
// when {
// environment name: 'CHOICE', value: 'Two'
// }
//
// // input {
// // message "Okay to continue?"
// // ok "Yes"
// // submitter "alice,bob"
// // parameters {
// // string(name: 'Person', defaultValue: 'Shashang Sheth', description: 'Whom shall I say hello to?')
// // }
// // }
//
// steps {
// // addShortText background: '', borderColor: '', color: '', link: '', text: 'Two'
// echo "Two"
// sh 'ENV_URL=${ENV_URL}'
// sh 'env'
// sh 'echo -e "\\e[31mHello"'
// sh 'mvn --version'
// }
// }
// }
// }
pipeline {
agent none
stages {
stage('Non-Parallel Stage') {
agent {
label 'Group1'
}
steps {
echo 'This stage will be executed first.'
}
}
stage('Parallel Stage') {
agent {
label 'Workstation'
}
failFast true
// parallel {
// stage('Branch A') {
// steps {
// echo "On Branch A"
// }
// }
// stage('Branch B') {
// steps {
// echo "On Branch B"
// }
// }
// stage('Branch C') {
stages {
stage('Nested 1') {
steps {
echo "In stage Nested 1 within Branch C"
}
}
stage('Nested 2') {
steps {
echo "In stage Nested 2 within Branch C"
}
}
}
// }
// }
}
}
}