forked from NetApp/trident
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
82 lines (59 loc) · 1.41 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
@Library(['tools@master', 'tools-override@main']) _
node {
def error_message = ''
def slack_result = ''
try {
stage('Setup') {
setup(
repository: 'trident'
)
}
def stages = []
stage('Create-Stages') {
try {
echo "Calling create stages"
def max_parallel_stages = 10
if (env.MAX_PARALLEL_STAGES) {
max_parallel_stages = env.MAX_PARALLEL_STAGES
}
stages = create_stages(
parallelism: max_parallel_stages,
repository: 'trident'
)
} catch(Exception e) {
error 'Create-Stages: ' + e.getMessage()
}
}
execute_parallel_stages(
stages: stages
)
if (env.STOP_ON_STAGE_FAILURES == 'false') {
stage('Check-Status') {
if (process_status_files() == false) {
failures = readFile file: 'failure_report.txt'
error 'Check-Status: One or more stages have failed\n' + failures
}
}
}
stage('Propagate') {
propagate_changes(
stage: 'Propagate'
)
archive_to_seclab(
stage: 'Propagate'
)
}
slack_result = 'SUCCESS'
} catch(Exception e) {
slack_result = 'FAILURE'
error_message = e.getMessage()
error error_message
} finally {
stage('Cleanup') {
cleanup(
error_message: error_message,
slack_result: slack_result
)
}
}
}