forked from TheThingsProducts/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
62 lines (60 loc) · 2.17 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
#!groovy
node {
gitCommit = ""
stage('Checkout') {
checkout scm
sh './git-clean.sh'
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
shortCommit = gitCommit.take(8)
currentBuild.displayName = "#${env.BUILD_NUMBER} [${shortCommit}]"
}
stage('Static code analysis') {
dir ('firmware') {
sh 'cppcheck --enable=all --inconclusive --force --xml --xml-version=2 src 2> cppcheck.xml'
step([$class: 'CppcheckPublisher',
pattern: "cppcheck.xml",
ignoreBlankFiles: false, threshold: "",
allowNoReport: false,
newThreshold: "0", failureThreshold: "",
newFailureThreshold: "", healthy: "", unHealthy: "",
severityError: true,
severityWarning: true,
severityStyle: false,
severityPerformance: false,
severityInformation: false,
severityNoCategory: false,
severityPortability: false,
xSize: 500, ySize: 200,
numBuildsInGraph: 0,
displayAllErrors: true,
displayErrorSeverity: true,
displayWarningSeverity: true,
displayStyleSeverity: true,
displayPerformanceSeverity: true,
displayInformationSeverity: true,
displayNoCategorySeverity: true,
displayPortabilitySeverity: true])
step([$class: 'TasksPublisher', canComputeNew: false, defaultEncoding: '', excludePattern: '', healthy: '', high: 'FIXME', ignoreCase: true, low: 'REVIEW', normal: 'TODO', pattern: 'src/*.c,src/*.h,**/*.md', unHealthy: ''])
}
}
stage('Build') {
dir ('firmware') {
sh './generate_version_header.sh'
sh './fix_mplab.sh'
sh './compile.sh'
step([$class: 'WarningsPublisher', defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'GNU Make + GNU C Compiler (gcc)', pattern: 'compile_log.txt']], unHealthy: ''])
}
}
stage('Merge bootloader') {
dir ('firmware') {
sh './merge_bootloader.sh'
}
}
stage('Package') {
dir ('firmware') {
sh './generate_hex_with_checksum.sh'
zip archive: true, glob: "firmware.hex, checksums", zipFile: "things-gateway-${env.BRANCH_NAME}-${env.BUILD_NUMBER}-${shortCommit}.zip"
archiveArtifacts artifacts: 'TTN_Gateway.X/dist/TTN_Gateway_v1/production/TTN_Gateway.X.production.*, *with-bootloader.hex'
}
}
}