-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathJenkinsfile
143 lines (139 loc) · 5.04 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@Library('slack-notification')
import org.gradiant.jenkins.slack.SlackNotifier
pipeline {
agent none
triggers { cron('@daily') }
stages {
stage('Tests') {
parallel {
stage('typos') {
agent {
dockerfile {
label 'generic-docker'
filename 'ci/typos.Dockerfile'
additionalBuildArgs '--build-arg VERSION=1.16'
args '-u 0:0 --rm'
}
}
steps {
dir('tree') {
sh script: 'typos --exclude 20_cfe_basics/cfengine/ --exclude 10_ncf_internals/modules/', label: 'check typos'
}
}
post {
failure {
script {
new SlackNotifier().notifyResult("shell-team")
}
}
}
}
stage('python') {
agent {
dockerfile {
label 'generic-docker'
filename 'ci/python.Dockerfile'
args '-u 0:0 --rm'
}
}
steps {
sh script: './qa-test --python', label: 'python scripts lint'
sh script: './qa-test --quick', label: 'quick method tests'
}
post {
failure {
script {
new SlackNotifier().notifyResult("shell-team")
}
}
}
}
}
}
stage('methods') {
agent {
dockerfile {
label 'generic-docker'
filename 'ci/methods.Dockerfile'
// Run tests as root
args '-u 0:0 --rm'
additionalBuildArgs "--build-arg OS=ubuntu:20.04"
}
}
steps {
catchError {
sh script: 'PATH="/opt/rudder/bin:$PATH" make test-unsafe', label: 'test methods'
}
// clean leftover files owned by root anyway
sh script: 'rm -rf tests/acceptance/.succeeded', label: 'cleanup'
sh script: 'rm -rf tests/acceptance/.failed', label: 'cleanup'
sh script: 'rm -rf tests/acceptance/workdir', label: 'cleanup'
}
post {
failure {
script {
new SlackNotifier().notifyResult("shell-team")
}
}
}
}
stage("Compatibility tests") {
// Expensive tests only done daily on branches
when {
allOf {
triggeredBy 'TimerTrigger'
not { changeRequest() }
}
}
matrix {
axes {
axis {
name 'OS'
values 'debian:11'
}
}
stages {
stage('methods') {
agent {
dockerfile {
label 'generic-docker'
filename 'ci/methods.Dockerfile'
// Run tests as root
args "-u 0:0 --rm"
additionalBuildArgs "--build-arg OS=${OS}"
}
}
steps {
catchError {
sh script: 'PATH="/opt/rudder/bin:$PATH" make test', label: 'test methods'
}
// clean leftover files owned by root anyway
sh script: 'rm -rf tests/acceptance/.succeeded', label: 'cleanup'
sh script: 'rm -rf tests/acceptance/.failed', label: 'cleanup'
sh script: 'rm -rf tests/acceptance/workdir', label: 'cleanup'
}
post {
failure {
script {
new SlackNotifier().notifyResult("shell-team")
}
}
}
}
}
}
}
stage('End') {
steps {
echo 'End of build'
}
post {
fixed {
script {
new SlackNotifier().notifyResult("shell-team")
}
}
}
}
}
}