-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathJenkinsfile
81 lines (72 loc) · 2.42 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
pipeline {
agent any
environment {
CXX = "g++-6.4.0"
LD = "g++-6.4.0"
ETL_MKL = 'true'
}
stages {
stage ('git'){
steps {
checkout([
$class: 'GitSCM',
branches: scm.branches,
doGenerateSubmoduleConfigurations: false,
extensions: scm.extensions + [[$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
submoduleCfg: [],
userRemoteConfigs: scm.userRemoteConfigs])
}
}
stage ('pre-analysis') {
steps {
sh 'cppcheck --xml-version=2 --enable=all --std=c++11 include/dll/*.hpp test/src/*.cpp test_compile/*.cpp 2> cppcheck_report.xml'
sh 'sloccount --duplicates --wide --details include/dll/*.hpp test/src/*.cpp test_compile/*.cpp > sloccount.sc'
sh 'cccc include/dll/*.hpp test/*.cpp test_compile/*.cpp || true'
}
}
stage ('build'){
steps {
sh 'make clean'
sh 'CXX=g++-6.4.0 LD=g++-6.4.0 ETL_MKL=true make -j6 release_debug'
}
}
stage ('test'){
steps {
sh "LD_LIBRARY_PATH=\"${env.LD_LIBRARY_PATH}:/opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64\" ./release_debug/bin/dll_test_unit -r junit -d yes -o catch_report.xml || true"
archive 'catch_report.xml'
junit 'catch_report.xml'
}
}
stage ('sonar-master'){
when {
branch 'master'
}
steps {
sh "/opt/sonar-runner/bin/sonar-runner"
}
}
stage ('sonar-branch'){
when {
not {
branch 'master'
}
}
steps {
sh "/opt/sonar-runner/bin/sonar-runner -Dsonar.branch=${env.BRANCH_NAME}"
}
}
}
post {
always {
script {
if (currentBuild.result == null) {
currentBuild.result = 'SUCCESS'
}
}
step([$class: 'Mailer',
notifyEveryUnstableBuild: true,
recipients: "[email protected]",
sendToIndividuals: true])
}
}
}