Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Jenkinsfile@105:0b691b27144a, 2018-09-26 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Sep 26 10:30:19 2018 +0100
- Revision:
- 105:0b691b27144a
- Parent:
- 103:9982165eb577
- Child:
- 111:b51a8fd84785
Merge branch 'mbed-os-5.10.0-oob'
* mbed-os-5.10.0-oob:
Update mbed-os to 5.10.0-rc3 (#220)
Updating mbed-os to mbed-os-5.10.0-rc2
Use Default meshinterface from Mbed OS 5.10
Update Jenkinsfile
Updating mbed-os to mbed-os-5.10.0-rc1
Remove sd-driver and update README (#213)
Remove external RF drivers
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-mesh-minimal
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbed_official | 26:b28ab71ff595 | 1 | properties ([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [ |
| mbed_official | 52:27692043e962 | 2 | [$class: 'StringParameterDefinition', name: 'mbed_os_revision', defaultValue: '', description: 'Revision of mbed-os to build. Use format "pull/PR-NUMBER/head" to access mbed-os PR'], |
| mbed_official | 26:b28ab71ff595 | 3 | [$class: 'BooleanParameterDefinition', name: 'smoke_test', defaultValue: false, description: 'Enable to run HW smoke test after building'] |
| mbed_official | 26:b28ab71ff595 | 4 | ]]]) |
| mbed_official | 26:b28ab71ff595 | 5 | |
| mbed_official | 52:27692043e962 | 6 | if (params.mbed_os_revision == '') { |
| mbed_official | 52:27692043e962 | 7 | echo 'Use mbed OS revision from mbed-os.lib' |
| mbed_official | 52:27692043e962 | 8 | } else { |
| mbed_official | 52:27692043e962 | 9 | echo "Use mbed OS revisiong ${params.mbed_os_revision}" |
| mbed_official | 52:27692043e962 | 10 | if (params.mbed_os_revision.matches('pull/\\d+/head')) { |
| mbed_official | 52:27692043e962 | 11 | echo "Revision is a Pull Request" |
| mbed_official | 52:27692043e962 | 12 | } |
| mbed_official | 52:27692043e962 | 13 | } |
| mbed_official | 32:8b28e79d2ed0 | 14 | echo "Run smoke tests: ${params.smoke_test}" |
| mbed_official | 26:b28ab71ff595 | 15 | |
| mbed_official | 26:b28ab71ff595 | 16 | |
| mbed_official | 26:b28ab71ff595 | 17 | // Map RaaS instances to corresponding test suites |
| mbed_official | 52:27692043e962 | 18 | // Run only selected set of tests. |
| mbed_official | 52:27692043e962 | 19 | // Board: K64F |
| mbed_official | 52:27692043e962 | 20 | // Radios: Atmel & MCR20A |
| mbed_official | 52:27692043e962 | 21 | // configurations: 6LP + Thread |
| mbed_official | 26:b28ab71ff595 | 22 | def raas = [ |
| mbed_official | 26:b28ab71ff595 | 23 | "lowpan_mesh_minimal_smoke_k64f_atmel.json": "8001", |
| mbed_official | 52:27692043e962 | 24 | // "lowpan_mesh_minimal_smoke_k64f_mcr20.json": "8034", |
| mbed_official | 52:27692043e962 | 25 | // "lowpan_mesh_minimal_smoke_429zi_atmel.json": "8030", |
| mbed_official | 52:27692043e962 | 26 | // "lowpan_mesh_minimal_smoke_429zi_mcr20.json": "8033", |
| mbed_official | 52:27692043e962 | 27 | // "lowpan_mesh_minimal_smoke_ublox_atmel.json": "8031", |
| mbed_official | 52:27692043e962 | 28 | // "thread_mesh_minimal_smoke_k64f_atmel.json": "8007" |
| mbed_official | 26:b28ab71ff595 | 29 | "thread_mesh_minimal_smoke_k64f_mcr20.json": "8034", |
| mbed_official | 52:27692043e962 | 30 | // "thread_mesh_minimal_smoke_429zi_atmel.json": "8030", |
| mbed_official | 52:27692043e962 | 31 | // "thread_mesh_minimal_smoke_429zi_mcr20.json": "8033", |
| mbed_official | 52:27692043e962 | 32 | // "thread_mesh_minimal_smoke_ublox_atmel.json": "8031" |
| mbed_official | 26:b28ab71ff595 | 33 | ] |
| mbed_official | 26:b28ab71ff595 | 34 | |
| mbed_official | 21:6c1e9147037c | 35 | // List of targets with supported RF shields to compile |
| mbed_official | 21:6c1e9147037c | 36 | def targets = [ |
| mbed_official | 105:0b691b27144a | 37 | "K64F": ["ATMEL", "MCR20A"], |
| mbed_official | 105:0b691b27144a | 38 | "NUCLEO_F401RE": ["ATMEL", "MCR20A"], |
| mbed_official | 105:0b691b27144a | 39 | "NUCLEO_F429ZI": ["ATMEL", "MCR20A"], |
| mbed_official | 105:0b691b27144a | 40 | //"NCS36510": ["internal"], |
| mbed_official | 52:27692043e962 | 41 | "UBLOX_EVK_ODIN_W2": ["ATMEL"], |
| mbed_official | 105:0b691b27144a | 42 | "KW24D": ["internal"] |
| mbed_official | 21:6c1e9147037c | 43 | ] |
| mbed_official | 34:bc1827b97c5e | 44 | |
| mbed_official | 21:6c1e9147037c | 45 | // Map toolchains to compilers |
| mbed_official | 21:6c1e9147037c | 46 | def toolchains = [ |
| mbed_official | 21:6c1e9147037c | 47 | ARM: "armcc", |
| mbed_official | 21:6c1e9147037c | 48 | GCC_ARM: "arm-none-eabi-gcc", |
| mbed_official | 58:e0f2bf24e6db | 49 | IAR: "IAR-linux" |
| mbed_official | 21:6c1e9147037c | 50 | ] |
| mbed_official | 21:6c1e9147037c | 51 | |
| mbed_official | 21:6c1e9147037c | 52 | // Supported RF shields |
| mbed_official | 21:6c1e9147037c | 53 | def radioshields = [ |
| mbed_official | 21:6c1e9147037c | 54 | "ATMEL", |
| mbed_official | 105:0b691b27144a | 55 | "MCR20A", |
| mbed_official | 105:0b691b27144a | 56 | "internal" |
| mbed_official | 21:6c1e9147037c | 57 | ] |
| mbed_official | 21:6c1e9147037c | 58 | |
| mbed_official | 21:6c1e9147037c | 59 | // Mesh interfaces: 6LoWPAN and Thread |
| mbed_official | 21:6c1e9147037c | 60 | def meshinterfaces = [ |
| mbed_official | 21:6c1e9147037c | 61 | "6lp", |
| mbed_official | 21:6c1e9147037c | 62 | "thd" |
| mbed_official | 21:6c1e9147037c | 63 | ] |
| mbed_official | 34:bc1827b97c5e | 64 | |
| mbed_official | 21:6c1e9147037c | 65 | def stepsForParallel = [:] |
| mbed_official | 21:6c1e9147037c | 66 | |
| mbed_official | 21:6c1e9147037c | 67 | // Jenkins pipeline does not support map.each, we need to use oldschool for loop |
| mbed_official | 21:6c1e9147037c | 68 | for (int i = 0; i < targets.size(); i++) { |
| mbed_official | 21:6c1e9147037c | 69 | for(int j = 0; j < toolchains.size(); j++) { |
| mbed_official | 21:6c1e9147037c | 70 | for(int k = 0; k < radioshields.size(); k++) { |
| mbed_official | 21:6c1e9147037c | 71 | for(int l = 0; l < meshinterfaces.size(); l++) { |
| mbed_official | 21:6c1e9147037c | 72 | def target = targets.keySet().asList().get(i) |
| mbed_official | 21:6c1e9147037c | 73 | def allowed_shields = targets.get(target) |
| mbed_official | 21:6c1e9147037c | 74 | def toolchain = toolchains.keySet().asList().get(j) |
| mbed_official | 21:6c1e9147037c | 75 | def compilerLabel = toolchains.get(toolchain) |
| mbed_official | 21:6c1e9147037c | 76 | def radioshield = radioshields.get(k) |
| mbed_official | 21:6c1e9147037c | 77 | def meshInterface = meshinterfaces.get(l) |
| mbed_official | 27:2b3fc6ca5872 | 78 | |
| mbed_official | 21:6c1e9147037c | 79 | def stepName = "${target} ${toolchain} ${radioshield} ${meshInterface}" |
| mbed_official | 21:6c1e9147037c | 80 | if(allowed_shields.contains(radioshield)) { |
| mbed_official | 21:6c1e9147037c | 81 | stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, radioshield, meshInterface) |
| mbed_official | 21:6c1e9147037c | 82 | } |
| mbed_official | 21:6c1e9147037c | 83 | } |
| mbed_official | 21:6c1e9147037c | 84 | } |
| mbed_official | 21:6c1e9147037c | 85 | } |
| mbed_official | 21:6c1e9147037c | 86 | } |
| mbed_official | 21:6c1e9147037c | 87 | |
| mbed_official | 26:b28ab71ff595 | 88 | def parallelRunSmoke = [:] |
| mbed_official | 26:b28ab71ff595 | 89 | |
| mbed_official | 26:b28ab71ff595 | 90 | // Need to compare boolean against string value |
| mbed_official | 34:bc1827b97c5e | 91 | if ( params.smoke_test == true ) { |
| mbed_official | 26:b28ab71ff595 | 92 | // Generate smoke tests based on suite amount |
| mbed_official | 26:b28ab71ff595 | 93 | for(int i = 0; i < raas.size(); i++) { |
| mbed_official | 26:b28ab71ff595 | 94 | def suite_to_run = raas.keySet().asList().get(i) |
| mbed_official | 26:b28ab71ff595 | 95 | def raasPort = raas.get(suite_to_run) |
| mbed_official | 26:b28ab71ff595 | 96 | // Parallel execution needs unique step names. Remove .json file ending. |
| mbed_official | 26:b28ab71ff595 | 97 | def smokeStep = "${raasPort} ${suite_to_run.substring(0, suite_to_run.indexOf('.'))}" |
| mbed_official | 26:b28ab71ff595 | 98 | parallelRunSmoke[smokeStep] = run_smoke(targets, toolchains, radioshields, meshinterfaces, raasPort, suite_to_run) |
| mbed_official | 26:b28ab71ff595 | 99 | } |
| mbed_official | 26:b28ab71ff595 | 100 | } |
| mbed_official | 26:b28ab71ff595 | 101 | |
| mbed_official | 21:6c1e9147037c | 102 | timestamps { |
| mbed_official | 21:6c1e9147037c | 103 | parallel stepsForParallel |
| mbed_official | 26:b28ab71ff595 | 104 | parallel parallelRunSmoke |
| mbed_official | 21:6c1e9147037c | 105 | } |
| mbed_official | 21:6c1e9147037c | 106 | |
| mbed_official | 21:6c1e9147037c | 107 | def buildStep(target, compilerLabel, toolchain, radioShield, meshInterface) { |
| mbed_official | 21:6c1e9147037c | 108 | return { |
| mbed_official | 21:6c1e9147037c | 109 | stage ("${target}_${compilerLabel}_${radioShield}_${meshInterface}") { |
| mbed_official | 21:6c1e9147037c | 110 | node ("${compilerLabel}") { |
| mbed_official | 21:6c1e9147037c | 111 | deleteDir() |
| mbed_official | 21:6c1e9147037c | 112 | dir("mbed-os-example-mesh-minimal") { |
| mbed_official | 21:6c1e9147037c | 113 | checkout scm |
| mbed_official | 50:5d4045379c2f | 114 | def config_file = "mbed_app.json" |
| mbed_official | 105:0b691b27144a | 115 | def config_suffix = "" |
| mbed_official | 105:0b691b27144a | 116 | |
| mbed_official | 105:0b691b27144a | 117 | if ("${radioShield}" != "internal") { |
| mbed_official | 105:0b691b27144a | 118 | config_suffix = "_${radioShield}" |
| mbed_official | 105:0b691b27144a | 119 | } |
| mbed_official | 21:6c1e9147037c | 120 | |
| mbed_official | 21:6c1e9147037c | 121 | if ("${meshInterface}" == "thd") { |
| mbed_official | 105:0b691b27144a | 122 | config_file = "./configs/mesh_thread${config_suffix}.json" |
| mbed_official | 51:de6c96c52689 | 123 | // Use systest Thread Border Router for testing (CH=18, PANID=BAAB) |
| mbed_official | 51:de6c96c52689 | 124 | execute("sed -i '/mbed-mesh-api.thread-device-type\":/a \"mbed-mesh-api.thread-config-channel\": 18,' ${config_file}") |
| mbed_official | 51:de6c96c52689 | 125 | execute("sed -i '/mbed-mesh-api.thread-device-type\":/a \"mbed-mesh-api.thread-config-panid\": \"0xBAAB\",' ${config_file}") |
| mbed_official | 68:2330fbeb4926 | 126 | execute("sed -i 's/\"nanostack.configuration\": \"thread_router\"/\"nanostack.configuration\": \"thread_end_device\"/' ${config_file}") |
| mbed_official | 52:27692043e962 | 127 | execute("sed -i 's/\"mbed-mesh-api.thread-device-type\": \"MESH_DEVICE_TYPE_THREAD_ROUTER\"/\"mbed-mesh-api.thread-device-type\": \"MESH_DEVICE_TYPE_THREAD_MINIMAL_END_DEVICE\"/' ${config_file}") |
| mbed_official | 53:82a191e2c133 | 128 | } |
| mbed_official | 21:6c1e9147037c | 129 | |
| mbed_official | 21:6c1e9147037c | 130 | if ("${meshInterface}" == "6lp") { |
| mbed_official | 105:0b691b27144a | 131 | config_file = "./configs/mesh_6lowpan${config_suffix}.json" |
| mbed_official | 51:de6c96c52689 | 132 | // Use systest 6LoWPAN Border Router for testing (CH=17, PANID=ABBA) |
| mbed_official | 51:de6c96c52689 | 133 | execute("sed -i 's/\"mbed-mesh-api.6lowpan-nd-channel\": 12/\"mbed-mesh-api.6lowpan-nd-channel\": 17/' ${config_file}") |
| mbed_official | 51:de6c96c52689 | 134 | execute("sed -i 's/\"mbed-mesh-api.6lowpan-nd-panid-filter\": \"0xffff\"/\"mbed-mesh-api.6lowpan-nd-panid-filter\": \"0xABBA\"/' ${config_file}") |
| mbed_official | 21:6c1e9147037c | 135 | } |
| mbed_official | 26:b28ab71ff595 | 136 | |
| mbed_official | 52:27692043e962 | 137 | // For KW24D, we need to optimize for low memory |
| mbed_official | 52:27692043e962 | 138 | if ("${target}" == "KW24D") { |
| mbed_official | 52:27692043e962 | 139 | // Use optimal mbed TLS config file, need double escaping of '\' characters, first ones to escape Grooy, second ones to escape shell |
| mbed_official | 52:27692043e962 | 140 | // Need to use SH shells |
| mbed_official | 52:27692043e962 | 141 | sh("sed -i '/\"target_overrides\"/ i \"macros\": [\"MBEDTLS_USER_CONFIG_FILE=\\\\\"mbedtls_config.h\\\\\"\"],' ${config_file}") |
| mbed_official | 52:27692043e962 | 142 | // Limit mesh heap size to 11kB |
| mbed_official | 52:27692043e962 | 143 | execute("sed -i 's/mbed-mesh-api.heap-size\": .*,/mbed-mesh-api.heap-size\": 11000,/' ${config_file}") |
| mbed_official | 52:27692043e962 | 144 | // Limit event loop heap size |
| mbed_official | 52:27692043e962 | 145 | execute("sed -i '/target.features_add/ i \"nanostack-hal.event_loop_thread_stack_size\": 2048,' ${config_file}") |
| mbed_official | 53:82a191e2c133 | 146 | if ("${toolchain}" == "GCC_ARM" && "${meshInterface}" == "thd") { |
| mbed_official | 53:82a191e2c133 | 147 | execute("sed -i 's/mbed-mesh-api.heap-size\": .*,/mbed-mesh-api.heap-size\": 15000,/' ${config_file}") |
| mbed_official | 53:82a191e2c133 | 148 | execute("sed -i '/mbed-mesh-api.thread-device-type\":/a \"mbed-mesh-api.use-malloc-for-heap\": true,' ${config_file}") |
| mbed_official | 53:82a191e2c133 | 149 | } |
| mbed_official | 52:27692043e962 | 150 | } |
| mbed_official | 52:27692043e962 | 151 | |
| mbed_official | 51:de6c96c52689 | 152 | // Activate traces |
| mbed_official | 51:de6c96c52689 | 153 | execute("sed -i 's/\"mbed-trace.enable\": false/\"mbed-trace.enable\": true/' ${config_file}") |
| mbed_official | 51:de6c96c52689 | 154 | |
| mbed_official | 26:b28ab71ff595 | 155 | // Set mbed-os to revision received as parameter |
| mbed_official | 21:6c1e9147037c | 156 | execute ("mbed deploy --protocol ssh") |
| mbed_official | 52:27692043e962 | 157 | if (params.mbed_os_revision != '') { |
| mbed_official | 52:27692043e962 | 158 | dir ("mbed-os") { |
| mbed_official | 52:27692043e962 | 159 | if (params.mbed_os_revision.matches('pull/\\d+/head')) { |
| mbed_official | 52:27692043e962 | 160 | execute("git fetch origin ${params.mbed_os_revision}:PR") |
| mbed_official | 52:27692043e962 | 161 | execute("git checkout PR") |
| mbed_official | 52:27692043e962 | 162 | } else { |
| mbed_official | 52:27692043e962 | 163 | execute ("git checkout ${params.mbed_os_revision}") |
| mbed_official | 52:27692043e962 | 164 | } |
| mbed_official | 52:27692043e962 | 165 | } |
| mbed_official | 21:6c1e9147037c | 166 | } |
| mbed_official | 103:9982165eb577 | 167 | |
| mbed_official | 50:5d4045379c2f | 168 | execute ("mbed compile --build out/${target}_${toolchain}_${radioShield}_${meshInterface}/ -m ${target} -t ${toolchain} -c --app-config ${config_file}") |
| mbed_official | 21:6c1e9147037c | 169 | } |
| mbed_official | 26:b28ab71ff595 | 170 | stash name: "${target}_${toolchain}_${radioShield}_${meshInterface}", includes: '**/mbed-os-example-mesh-minimal.bin' |
| mbed_official | 21:6c1e9147037c | 171 | archive '**/mbed-os-example-mesh-minimal.bin' |
| mbed_official | 26:b28ab71ff595 | 172 | step([$class: 'WsCleanup']) |
| mbed_official | 21:6c1e9147037c | 173 | } |
| mbed_official | 21:6c1e9147037c | 174 | } |
| mbed_official | 21:6c1e9147037c | 175 | } |
| mbed_official | 21:6c1e9147037c | 176 | } |
| mbed_official | 26:b28ab71ff595 | 177 | |
| mbed_official | 26:b28ab71ff595 | 178 | def run_smoke(targets, toolchains, radioshields, meshinterfaces, raasPort, suite_to_run) { |
| mbed_official | 26:b28ab71ff595 | 179 | return { |
| mbed_official | 26:b28ab71ff595 | 180 | // Remove .json from suite name |
| mbed_official | 26:b28ab71ff595 | 181 | def suiteName = suite_to_run.substring(0, suite_to_run.indexOf('.')) |
| mbed_official | 26:b28ab71ff595 | 182 | stage ("smoke_${raasPort}_${suiteName}") { |
| mbed_official | 30:81d713ba997d | 183 | node ("mesh-test") { |
| mbed_official | 26:b28ab71ff595 | 184 | deleteDir() |
| mbed_official | 26:b28ab71ff595 | 185 | dir("mbed-clitest") { |
| mbed_official | 26:b28ab71ff595 | 186 | git "git@github.com:ARMmbed/mbed-clitest.git" |
| mbed_official | 65:cb583d690d43 | 187 | execute("git checkout ${env.LATEST_CLITEST_STABLE_REL}") |
| mbed_official | 52:27692043e962 | 188 | } |
| mbed_official | 52:27692043e962 | 189 | dir("testcases") { |
| mbed_official | 52:27692043e962 | 190 | git "git@github.com:ARMmbed/mbed-clitest-suites.git" |
| mbed_official | 52:27692043e962 | 191 | execute("git checkout master") |
| mbed_official | 52:27692043e962 | 192 | execute("git submodule update --init --recursive") |
| mbed_official | 52:27692043e962 | 193 | dir("6lowpan") { |
| mbed_official | 26:b28ab71ff595 | 194 | execute("git checkout master") |
| mbed_official | 26:b28ab71ff595 | 195 | } |
| mbed_official | 52:27692043e962 | 196 | dir("thread-tests") { |
| mbed_official | 52:27692043e962 | 197 | execute("git checkout master") |
| mbed_official | 52:27692043e962 | 198 | } |
| mbed_official | 52:27692043e962 | 199 | } |
| mbed_official | 26:b28ab71ff595 | 200 | |
| mbed_official | 52:27692043e962 | 201 | for (int i = 0; i < targets.size(); i++) { |
| mbed_official | 52:27692043e962 | 202 | for(int j = 0; j < toolchains.size(); j++) { |
| mbed_official | 52:27692043e962 | 203 | for(int k = 0; k < radioshields.size(); k++) { |
| mbed_official | 52:27692043e962 | 204 | for(int l = 0; l < meshinterfaces.size(); l++) { |
| mbed_official | 52:27692043e962 | 205 | def target = targets.keySet().asList().get(i) |
| mbed_official | 52:27692043e962 | 206 | def allowed_shields = targets.get(target) |
| mbed_official | 52:27692043e962 | 207 | def toolchain = toolchains.keySet().asList().get(j) |
| mbed_official | 52:27692043e962 | 208 | def radioshield = radioshields.get(k) |
| mbed_official | 52:27692043e962 | 209 | def meshInterface = meshinterfaces.get(l) |
| mbed_official | 52:27692043e962 | 210 | // Skip unwanted combination |
| mbed_official | 52:27692043e962 | 211 | if (target == "NUCLEO_F401RE" && toolchain == "IAR") { |
| mbed_official | 52:27692043e962 | 212 | continue |
| mbed_official | 52:27692043e962 | 213 | } |
| mbed_official | 52:27692043e962 | 214 | if(allowed_shields.contains(radioshield)) { |
| mbed_official | 52:27692043e962 | 215 | unstash "${target}_${toolchain}_${radioshield}_${meshInterface}" |
| mbed_official | 26:b28ab71ff595 | 216 | } |
| mbed_official | 26:b28ab71ff595 | 217 | } |
| mbed_official | 26:b28ab71ff595 | 218 | } |
| mbed_official | 26:b28ab71ff595 | 219 | } |
| mbed_official | 26:b28ab71ff595 | 220 | } |
| mbed_official | 52:27692043e962 | 221 | env.RAAS_USERNAME = "user" |
| mbed_official | 52:27692043e962 | 222 | env.RAAS_PASSWORD = "user" |
| mbed_official | 79:4425f61286a3 | 223 | execute("./mbed-clitest/clitest.py --tcdir testcases --suitedir testcases/suites/ --suite ${suite_to_run} --type hardware --reset --raas http://rauni.mbedcloudtesting.com/ --raas_share_allocs --failure_return_value -vvv -w --log log_${raasPort}_${suiteName}") |
| mbed_official | 52:27692043e962 | 224 | archive "log_${raasPort}_${suiteName}/**/*" |
| mbed_official | 26:b28ab71ff595 | 225 | } |
| mbed_official | 26:b28ab71ff595 | 226 | } |
| mbed_official | 26:b28ab71ff595 | 227 | } |
| mbed_official | 26:b28ab71ff595 | 228 | } |