-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
151 lines (140 loc) · 3.58 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
144
145
146
147
148
149
150
151
pipeline {
agent {
node {
label 'x64 || rpi'
customWorkspace '/home/jenkins/iot/24V_SHIELD_BTT6030'
}
}
options {
buildDiscarder(
logRotator(
numToKeepStr: '5',
artifactNumToKeepStr: '5'
)
)
disableConcurrentBuilds()
}
/*
triggers {
cron('H H(0-1) * * *')
}
*/
stages {
stage('Build documentation') {
parallel {
/*-----------------------------------------------------------------------------
* html
*-----------------------------------------------------------------------------
*/
stage('HTML') {
steps {
echo "html"
sh ("export DOXY_BIN_PATH=/usr/local/bin/;cd ${env.WORKSPACE}/docs;/usr/bin/make html")
}
}
/*-----------------------------------------------------------------------------
* latex/pdf
*-----------------------------------------------------------------------------
*/
stage('PDF') {
steps {
echo "latex/pdf"
/*
sh ("export DOXY_BIN_PATH=/usr/local/bin/;cd ${env.WORKSPACE}/docs;/usr/bin/make pdf")
build(
job: 'dev/doxy_maker_pdf',
propagate: true,
parameters: [
[
$class: 'StringParameterValue',
name: 'WORKSPACE',
value: "${env.WORKSPACE}"
],
]
)
*/
}
}
} // end parallel
} // end docu build
stage('Check') {
steps {
sh "cd ${env.WORKSPACE};mkdir -p build;/usr/local/bin/cppcheck -v --enable=all --xml-version=2 -I examples src 2> build/cppcheck-report.xml"
} // end steps
} // end stage
stage('SonarQube') {
environment {
scannerHome = tool 'SonarQubeScanner'
}
steps {
withSonarQubeEnv('SonarQube') {
sh "${scannerHome}/bin/sonar-scanner -X"
}
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
timeout(time: 10, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
}
} // end steps
} // end stage
stage('Build') {
parallel {
/*-----------------------------------------------------------------------------
* development
*-----------------------------------------------------------------------------
*/
stage('DEVELOPMENT') {
steps {
echo "html deploy"
sh ("mkdir -p /mnt/raspel/Public/doxygen/Tle5012/;cd ${env.WORKSPACE}/docs;cp -r html /mnt/raspel/Public/doxygen/24V_SHIELD_BTT6030/")
}
}
/*-----------------------------------------------------------------------------
* production
*-----------------------------------------------------------------------------
*/
stage('PRODUCTION') {
steps {
echo "Production"
/*
build(
job: 'dev/I-Tec/CI-CD/task I-Tec grantDB',
propagate: true,
parameters: [
[
$class: 'StringParameterValue',
name: 'RAZWARE_TIER',
value: 'production'
],
[
$class: 'StringParameterValue',
name: 'RAZWEB_ROOT',
value: '/home/razweb/htdocs-vihlarazweb1'
],
[
$class: 'StringParameterValue',
name: 'RAMEZ_ROOT_URL',
value: 'https://vihlarazweb1.vih.infineon.com'
]
]
)
*/
}
}
} // end parallel
} // end stage
} // end stages
/*-----------------------------------------------------------------------------
* post
*-----------------------------------------------------------------------------
*/
post {
failure {
mail(
to: 'olaf.filies@t-online.de',
subject: "[EYENET JENKINS] 24V_SHIELD_BTT6030 pipeline:",
body: "Something during Jenkins pipeline run went wrong."
)
}
}
}