-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathJenkinsfile
More file actions
132 lines (127 loc) · 4.63 KB
/
Jenkinsfile
File metadata and controls
132 lines (127 loc) · 4.63 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
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
#!/usr/bin/env groovy
updateGitlabCommitStatus name: 'build', state: 'pending'
pipeline {
agent {
label 'x86_64'
}
options {
gitLabConnection('AVS GitLab')
buildDiscarder(logRotator(numToKeepStr:'10'))
skipDefaultCheckout()
}
triggers {
gitlab(triggerOnPush: true,
triggerOnMergeRequest: true,
triggerOpenMergeRequestOnPush: 'both',
pendingBuildName: "Jenkins",
branchFilterType: 'All')
pollSCM('H/60 * * * *')
}
stages {
stage('checkout') {
steps {
updateGitlabCommitStatus name: 'build', state: 'running'
dir('outpost-core') {
// https://hbryavsci1l.hb.dlr.de:8929/avionics-software-open/outpost-core.git
checkout scm
}
dir('scons-build-tools') {
git credentialsId: 'jenkins-ssh-gitlab',
url: 'ssh://git@hbryavsci1l.hb.dlr.de:10022/avionics-software-open/scons-build-tools.git'
}
}
}
stage("build") {
steps {
dir('outpost-core') {
sh 'make test'
}
}
}
stage("test") {
steps {
dir('outpost-core') {
step([$class: 'XUnitPublisher',
testTimeMargin: '3000',
thresholdMode: 1,
thresholds: [
[
$class: 'FailedThreshold',
failureNewThreshold: '',
failureThreshold: '0',
unstableNewThreshold: '',
unstableThreshold: ''
],
[
$class: 'SkippedThreshold',
failureNewThreshold: '',
failureThreshold: '',
unstableNewThreshold: '',
unstableThreshold: '0']
],
tools: [[
$class: 'GoogleTestType',
deleteOutputFiles: true,
failIfNotNew: true,
pattern: 'build/test/*.xml',
skipNoTestFiles: false,
stopProcessingIfError: true]]])
}
}
}
stage("cppcheck") {
steps {
parallel (
"cppcheck modules": {
dir('outpost-core') {
sh 'make cppcheck'
}
},
"cppcheck tests": {
dir('outpost-core') {
sh 'make cppcheck-tests'
}
},
"cppcheck unittests": {
dir('outpost-core') {
sh 'make cppcheck-unittests'
}
}
)
}
}
stage("Check for Compiler warnings") {
steps {
dir('outpost-core') {
publishCppcheck pattern: "build/cppcheck/*.xml"
recordIssues blameDisabled: true,
tools: [
gcc4(), clang()
],
qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
recordIssues blameDisabled: true,
tools: [
cppCheck(pattern: "build/cppcheck/*.xml")
],
qualityGates: [[threshold: 1, type: 'TOTAL_ERROR', unstable: false],
[threshold: 1, type: 'TOTAL_HIGH', unstable: false],
[threshold: 3, type: 'TOTAL_NORMAL', unstable: true]] // TODO reduce threshold when sources have been cleaned
}
}
}
}
post {
failure {
updateGitlabCommitStatus name: 'build', state: 'failed'
}
unstable {
updateGitlabCommitStatus name: 'build', state: 'failed'
}
success {
updateGitlabCommitStatus name: 'build', state: 'success'
}
always {
archiveArtifacts artifacts: '**/build/cppcheck/**/*'
}
}
}