Repository navigation
Expand file tree
/
Copy pathflow.groovy
More file actions
59 lines (50 loc) · 1.4 KB
/
Copy pathflow.groovy
File metadata and controls
59 lines (50 loc) · 1.4 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
node {
catchError {
// compile project
stage('Compile') {
sh "echo 'starting compile'"
}
// running test
// building image and push to acceptance
// running acceptance api test
parallel firstBranch: {
stage ('Testing')
{
sh "echo 'running all tests.'"
sh "sleep 120"
sh "echo ''all tests are passed."
}
}, secondBranch: {
stage ('building image')
{
sh "echo 'creating container images.'"
sh "sleep 30"
}
stage ('deploy to acceptance')
{
sh "echo 'pushing image to acceptance'"
sh "sleep 30"
}
stage ('running api acceptance testing')
{
sh "echo 'running api acceptance testing'"
sh "sleep 10"
}
}
stage('Deploy production') {
sh "echo 'deploy to production'"
}
currentBuild.result = "SUCCESS"
}
switch (currentBuild.result) {
case "SUCCESS":
sh "echo 'build successed'"
break;
case "FAILURE":
sh "echo 'build failed'"
break;
default:
sh "echo 'Undetermined build result'"
break;
}
}