forked from contiki-os/contiki
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathJenkinsfile
86 lines (82 loc) · 2.71 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
#!/usr/bin/env groovy
/**
* Build Contiki Applications
*
*/
def examples = [
'hello-world',
'ping-ipv6',
'trickle-library',
'servreg-hack',
'http-socket',
'udp-ipv6',
'er-rest-example',
'webserver-ipv6',
]
def mikroe_apps = [
'sample-app',
'test-button',
'test-i2c',
'test-led',
'test-motion',
'test-proximity',
'test-relay',
'test-rtc',
'test-thermo3',
'test-uart'
]
properties([
buildDiscarder(logRotator(numToKeepStr: '30')),
parameters([
stringParam(defaultValue: '26', description: 'Set 6LoWPAN Channel', name: 'CHANNEL'),
stringParam(defaultValue: '0xabcd', description: 'Set 6LoWPAN PAN ID', name: 'PAN_ID'),
stringParam(defaultValue: '1', description: 'Set Serial port to use for console', name: 'PADS'),
])
])
node('docker && imgtec') {
def docker_image
docker_image = docker.image "imgtec/creator-builder:latest"
docker_image.inside {
stage('Prepare') {
checkout([$class: 'GitSCM',
userRemoteConfigs: scm.userRemoteConfigs,
branches: scm.branches,
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
submoduleCfg: scm.submoduleCfg,
browser: scm.browser,
gitTool: scm.gitTool,
extensions: scm.extensions + [
[$class: 'CleanCheckout'],
[$class: 'PruneStaleBranch'],
[$class: 'SubmoduleOption']
],
])
}
stage('Build') {
for (item in examples) {
try {
sh "cd examples/${item} && make -j8 TARGET=mikro-e CHANNEL=${params.CHANNEL} \
PAN_ID=${params.PAN_ID} USE_SERIAL_PADS=${params.PADS}"
sh "cd examples/${item} && xc32-bin2hex *.mikro-e && mv *.hex ${WORKSPACE}/"
} catch(exc) {
echo "Caught: ${exc}"
currentBuild.result = 'FAILURE'
}
}
for (item in mikroe_apps) {
try {
sh "cd platform/mikro-e/apps/${item} && make -j8 TARGET=mikro-e CHANNEL=${params.CHANNEL} \
PAN_ID=${params.PAN_ID} USE_SERIAL_PADS=${params.PADS}"
sh "cd platform/mikro-e/apps/${item} && xc32-bin2hex *.mikro-e && mv *.hex ${WORKSPACE}/"
} catch(exc) {
echo "Caught: ${exc}"
currentBuild.result = 'FAILURE'
}
}
}
stage('Upload') {
archiveArtifacts '*.hex'
deleteDir() // clean up the workspace to save space
}
}
}