Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

Commit 7515ef0

Browse files
authored
Merge branch 'master' into PAL1.0
2 parents 6d96550 + 01e0015 commit 7515ef0

File tree

2 files changed

+54
-22
lines changed

2 files changed

+54
-22
lines changed

Jenkinsfile

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// List of targets to compile
22
def targets = [
3-
"K64F"
3+
"K64F",
4+
"NUCLEO_F429ZI",
5+
"UBLOX_EVK_ODIN_W2"
46
]
57

68
// Map toolchains to compilers
@@ -11,23 +13,37 @@ def toolchains = [
1113
]
1214

1315
def configurations = [
14-
"default",
15-
"thread"
16+
"def": ["ETH"],
17+
"thd": ["ATMEL", "MCR20"],
18+
"6lp": ["ATMEL", "MCR20"]
1619
]
17-
20+
21+
def connectiontypes = [
22+
"ETH",
23+
"ATMEL",
24+
"MCR20"
25+
]
26+
1827
def stepsForParallel = [:]
1928

2029
// Jenkins pipeline does not support map.each, we need to use oldschool for loop
2130
for (int i = 0; i < targets.size(); i++) {
2231
for(int j = 0; j < toolchains.size(); j++) {
2332
for(int k = 0; k < configurations.size(); k++) {
24-
def target = targets.get(i)
25-
def toolchain = toolchains.keySet().asList().get(j)
26-
def compilerLabel = toolchains.get(toolchain)
27-
def config = configurations.get(k)
28-
29-
def stepName = "${target} ${toolchain} ${config}"
30-
stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, config)
33+
for(int l = 0; l < connectiontypes.size(); l++) {
34+
35+
def target = targets.get(i)
36+
def toolchain = toolchains.keySet().asList().get(j)
37+
def compilerLabel = toolchains.get(toolchain)
38+
def config = configurations.keySet().asList().get(k)
39+
def allowed_configs = configurations.get(config)
40+
def connectiontype = connectiontypes.get(l)
41+
42+
def stepName = "${target} ${toolchain} ${config} ${connectiontype}"
43+
if(allowed_configs.contains(connectiontype)) {
44+
stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, config, connectiontype)
45+
}
46+
}
3147
}
3248
}
3349
}
@@ -36,30 +52,46 @@ timestamps {
3652
parallel stepsForParallel
3753
}
3854

39-
def buildStep(target, compilerLabel, toolchain, configName) {
55+
def buildStep(target, compilerLabel, toolchain, configName, connectiontype) {
4056
return {
41-
stage ("${target}_${compilerLabel}_${configName}") {
57+
stage ("${target}_${compilerLabel}_${configName}_${connectiontype}") {
4258
node ("${compilerLabel}") {
4359
deleteDir()
4460
dir("mbed-os-example-client") {
4561
checkout scm
4662

47-
if ("${configName}" == "thread") {
48-
// Add IPV6 feature
49-
execute("sed -i 's/\"CLIENT\", \"COMMON_PAL\"/\"CLIENT\", \"IPV6\", \"COMMON_PAL\"/' mbed_app.json")
63+
if ("${configName}" == "thd") {
64+
// Change device type to Thread router
65+
execute("sed -i 's/\"NANOSTACK\", \"LOWPAN_ROUTER\", \"COMMON_PAL\"/\"NANOSTACK\", \"THREAD_ROUTER\", \"COMMON_PAL\"/' mbed_app.json")
5066
// Change connection type to thread
5167
execute ("sed -i 's/\"value\": \"ETHERNET\"/\"value\": \"MESH_THREAD\"/' mbed_app.json")
52-
// Add atmel-rf-driver
53-
execute ("mbed add https://github.com/ARMmbed/atmel-rf-driver")
5468
}
55-
69+
70+
if ("${configName}" == "6lp") {
71+
// Change connection type to 6LoWPAN
72+
execute ("sed -i 's/\"value\": \"ETHERNET\"/\"value\": \"MESH_LOWPAN_ND\"/' mbed_app.json")
73+
74+
// Change channel for HW tests
75+
execute ("sed -i 's/\"mbed-mesh-api.6lowpan-nd-channel\": 12/\"mbed-mesh-api.6lowpan-nd-channel\": 18/' mbed_app.json")
76+
}
77+
78+
if ("${connectiontype}" == "MCR20") {
79+
// Replace default rf shield
80+
execute ("sed -i 's/\"value\": \"ATMEL\"/\"value\": \"MCR20\"/' mbed_app.json")
81+
}
82+
5683
// Copy security.h to build
5784
mbed.getSecurityFile()
5885

5986
execute ("mbed deploy --protocol ssh")
60-
execute ("mbed compile --build .build/${target}_${compilerLabel}_${configName}/ -m ${target} -t ${toolchain} -c")
61-
archive '**/mbed-os-example-client.bin'
87+
88+
dir("mbed-os") {
89+
execute ("git fetch origin latest")
90+
execute ("git checkout FETCH_HEAD")
91+
}
92+
execute ("mbed compile --build out/${target}_${toolchain}_${configName}_${connectiontype}/ -m ${target} -t ${toolchain} -c")
6293
}
94+
archive '**/mbed-os-example-client.bin'
6395
}
6496
}
6597
}

mbed-os.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/mbed-os/#e435a07d9252f133ea3d9f6c95dfb176f32ab9b6
1+
https://github.com/ARMmbed/mbed-os/#e2617cc0e17f5c3fc2bae6a589c9bcfd3d1a717b

0 commit comments

Comments
 (0)