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@123:6b11bfd9dcae, 2017-12-20 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Dec 20 18:15:08 2017 +0000
- Revision:
- 123:6b11bfd9dcae
- Parent:
- 101:1999b1beb68d
Merge Mbed OS 5.7.0 OOB to master (#363)
Update Nanostack configuration option to mesh config files.
Update Jenkinsfile (#347)
Application defined version of mbed-os is used by default.
Mbed OS 5.7.0 taken into use.
(squashed commit)
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-client
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbed_official | 36:bfb6816a677c | 1 | properties ([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [ |
| mbed_official | 123:6b11bfd9dcae | 2 | [$class: 'StringParameterDefinition', name: 'mbed_os_revision', defaultValue: '', description: 'Revision of mbed-os to build. To access mbed-os PR use format "pull/PR number/head"'] |
| mbed_official | 36:bfb6816a677c | 3 | ]]]) |
| mbed_official | 36:bfb6816a677c | 4 | |
| mbed_official | 123:6b11bfd9dcae | 5 | if (params.mbed_os_revision == '') { |
| mbed_official | 123:6b11bfd9dcae | 6 | echo 'Use mbed OS revision from mbed-os.lib' |
| mbed_official | 123:6b11bfd9dcae | 7 | } else { |
| mbed_official | 123:6b11bfd9dcae | 8 | echo "Use mbed OS revisiong ${params.mbed_os_revision}" |
| mbed_official | 123:6b11bfd9dcae | 9 | if (params.mbed_os_revision.matches('pull/\\d+/head')) { |
| mbed_official | 101:1999b1beb68d | 10 | echo "Revision is a Pull Request" |
| mbed_official | 101:1999b1beb68d | 11 | } |
| mbed_official | 36:bfb6816a677c | 12 | } |
| mbed_official | 36:bfb6816a677c | 13 | |
| mbed_official | 18:628e22df9c41 | 14 | // List of targets to compile |
| mbed_official | 18:628e22df9c41 | 15 | def targets = [ |
| mbed_official | 27:3d32587bf8f7 | 16 | "K64F", |
| mbed_official | 27:3d32587bf8f7 | 17 | "NUCLEO_F429ZI", |
| mbed_official | 27:3d32587bf8f7 | 18 | "UBLOX_EVK_ODIN_W2" |
| mbed_official | 18:628e22df9c41 | 19 | ] |
| mbed_official | 66:8079b3572c2e | 20 | |
| mbed_official | 18:628e22df9c41 | 21 | // Map toolchains to compilers |
| mbed_official | 18:628e22df9c41 | 22 | def toolchains = [ |
| mbed_official | 18:628e22df9c41 | 23 | ARM: "armcc", |
| mbed_official | 18:628e22df9c41 | 24 | GCC_ARM: "arm-none-eabi-gcc", |
| mbed_official | 18:628e22df9c41 | 25 | IAR: "iar_arm" |
| mbed_official | 18:628e22df9c41 | 26 | ] |
| mbed_official | 18:628e22df9c41 | 27 | |
| mbed_official | 18:628e22df9c41 | 28 | def configurations = [ |
| mbed_official | 27:3d32587bf8f7 | 29 | "def": ["ETH"], |
| mbed_official | 27:3d32587bf8f7 | 30 | "thd": ["ATMEL", "MCR20"], |
| mbed_official | 27:3d32587bf8f7 | 31 | "6lp": ["ATMEL", "MCR20"] |
| mbed_official | 18:628e22df9c41 | 32 | ] |
| mbed_official | 27:3d32587bf8f7 | 33 | |
| mbed_official | 27:3d32587bf8f7 | 34 | def connectiontypes = [ |
| mbed_official | 27:3d32587bf8f7 | 35 | "ETH", |
| mbed_official | 27:3d32587bf8f7 | 36 | "ATMEL", |
| mbed_official | 27:3d32587bf8f7 | 37 | "MCR20" |
| mbed_official | 27:3d32587bf8f7 | 38 | ] |
| mbed_official | 27:3d32587bf8f7 | 39 | |
| mbed_official | 18:628e22df9c41 | 40 | def stepsForParallel = [:] |
| mbed_official | 18:628e22df9c41 | 41 | |
| mbed_official | 18:628e22df9c41 | 42 | // Jenkins pipeline does not support map.each, we need to use oldschool for loop |
| mbed_official | 18:628e22df9c41 | 43 | for (int i = 0; i < targets.size(); i++) { |
| mbed_official | 18:628e22df9c41 | 44 | for(int j = 0; j < toolchains.size(); j++) { |
| mbed_official | 18:628e22df9c41 | 45 | for(int k = 0; k < configurations.size(); k++) { |
| mbed_official | 27:3d32587bf8f7 | 46 | for(int l = 0; l < connectiontypes.size(); l++) { |
| mbed_official | 27:3d32587bf8f7 | 47 | |
| mbed_official | 27:3d32587bf8f7 | 48 | def target = targets.get(i) |
| mbed_official | 27:3d32587bf8f7 | 49 | def toolchain = toolchains.keySet().asList().get(j) |
| mbed_official | 27:3d32587bf8f7 | 50 | def compilerLabel = toolchains.get(toolchain) |
| mbed_official | 27:3d32587bf8f7 | 51 | def config = configurations.keySet().asList().get(k) |
| mbed_official | 27:3d32587bf8f7 | 52 | def allowed_configs = configurations.get(config) |
| mbed_official | 27:3d32587bf8f7 | 53 | def connectiontype = connectiontypes.get(l) |
| mbed_official | 27:3d32587bf8f7 | 54 | |
| mbed_official | 27:3d32587bf8f7 | 55 | def stepName = "${target} ${toolchain} ${config} ${connectiontype}" |
| mbed_official | 27:3d32587bf8f7 | 56 | if(allowed_configs.contains(connectiontype)) { |
| mbed_official | 27:3d32587bf8f7 | 57 | stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, config, connectiontype) |
| mbed_official | 27:3d32587bf8f7 | 58 | } |
| mbed_official | 27:3d32587bf8f7 | 59 | } |
| mbed_official | 18:628e22df9c41 | 60 | } |
| mbed_official | 18:628e22df9c41 | 61 | } |
| mbed_official | 18:628e22df9c41 | 62 | } |
| mbed_official | 18:628e22df9c41 | 63 | |
| mbed_official | 18:628e22df9c41 | 64 | timestamps { |
| mbed_official | 18:628e22df9c41 | 65 | parallel stepsForParallel |
| mbed_official | 18:628e22df9c41 | 66 | } |
| mbed_official | 18:628e22df9c41 | 67 | |
| mbed_official | 27:3d32587bf8f7 | 68 | def buildStep(target, compilerLabel, toolchain, configName, connectiontype) { |
| mbed_official | 18:628e22df9c41 | 69 | return { |
| mbed_official | 27:3d32587bf8f7 | 70 | stage ("${target}_${compilerLabel}_${configName}_${connectiontype}") { |
| mbed_official | 18:628e22df9c41 | 71 | node ("${compilerLabel}") { |
| mbed_official | 18:628e22df9c41 | 72 | deleteDir() |
| mbed_official | 18:628e22df9c41 | 73 | dir("mbed-os-example-client") { |
| mbed_official | 18:628e22df9c41 | 74 | checkout scm |
| mbed_official | 101:1999b1beb68d | 75 | def config_file = "mbed_app.json" |
| mbed_official | 66:8079b3572c2e | 76 | |
| mbed_official | 27:3d32587bf8f7 | 77 | if ("${configName}" == "thd") { |
| mbed_official | 101:1999b1beb68d | 78 | config_file = "./configs/mesh_thread.json" |
| mbed_official | 101:1999b1beb68d | 79 | // Update Thread channel and PANID |
| mbed_official | 101:1999b1beb68d | 80 | execute("sed -i 's/\"mbed-mesh-api.thread-config-channel\": 22/\"mbed-mesh-api.thread-config-channel\": 18/' ${config_file}") |
| mbed_official | 101:1999b1beb68d | 81 | execute("sed -i 's/\"mbed-mesh-api.thread-config-panid\": \"0x0700\"/\"mbed-mesh-api.thread-config-panid\": \"0xBAAB\"/' ${config_file}") |
| mbed_official | 101:1999b1beb68d | 82 | |
| mbed_official | 18:628e22df9c41 | 83 | } |
| mbed_official | 27:3d32587bf8f7 | 84 | |
| mbed_official | 27:3d32587bf8f7 | 85 | if ("${configName}" == "6lp") { |
| mbed_official | 101:1999b1beb68d | 86 | config_file = "./configs/mesh_6lowpan.json" |
| mbed_official | 27:3d32587bf8f7 | 87 | |
| mbed_official | 27:3d32587bf8f7 | 88 | // Change channel for HW tests |
| mbed_official | 101:1999b1beb68d | 89 | execute ("sed -i 's/\"mbed-mesh-api.6lowpan-nd-channel\": 12/\"mbed-mesh-api.6lowpan-nd-channel\": 17/' ${config_file}") |
| mbed_official | 66:8079b3572c2e | 90 | |
| mbed_official | 66:8079b3572c2e | 91 | //Use PANID filter |
| mbed_official | 101:1999b1beb68d | 92 | execute ("sed -i '/6lowpan-nd-channel\":/a \"mbed-mesh-api.6lowpan-nd-panid-filter\": \"0xABBA\",' ${config_file}") |
| mbed_official | 27:3d32587bf8f7 | 93 | } |
| mbed_official | 27:3d32587bf8f7 | 94 | |
| mbed_official | 27:3d32587bf8f7 | 95 | if ("${connectiontype}" == "MCR20") { |
| mbed_official | 27:3d32587bf8f7 | 96 | // Replace default rf shield |
| mbed_official | 101:1999b1beb68d | 97 | execute ("sed -i 's/\"value\": \"ATMEL\"/\"value\": \"MCR20\"/' ${config_file}") |
| mbed_official | 27:3d32587bf8f7 | 98 | } |
| mbed_official | 27:3d32587bf8f7 | 99 | |
| mbed_official | 18:628e22df9c41 | 100 | // Copy security.h to build |
| mbed_official | 18:628e22df9c41 | 101 | mbed.getSecurityFile() |
| mbed_official | 36:bfb6816a677c | 102 | |
| mbed_official | 36:bfb6816a677c | 103 | // Set mbed-os to revision received as parameter |
| mbed_official | 18:628e22df9c41 | 104 | execute ("mbed deploy --protocol ssh") |
| mbed_official | 123:6b11bfd9dcae | 105 | if (params.mbed_os_revision != '') { |
| mbed_official | 123:6b11bfd9dcae | 106 | dir("mbed-os") { |
| mbed_official | 123:6b11bfd9dcae | 107 | if (params.mbed_os_revision.matches('pull/\\d+/head')) { |
| mbed_official | 101:1999b1beb68d | 108 | // Use mbed-os PR and switch to branch created |
| mbed_official | 123:6b11bfd9dcae | 109 | execute("git fetch origin ${params.mbed_os_revision}:_PR_") |
| mbed_official | 101:1999b1beb68d | 110 | execute("git checkout _PR_") |
| mbed_official | 101:1999b1beb68d | 111 | } else { |
| mbed_official | 123:6b11bfd9dcae | 112 | execute ("git checkout ${params.mbed_os_revision}") |
| mbed_official | 123:6b11bfd9dcae | 113 | } |
| mbed_official | 101:1999b1beb68d | 114 | } |
| mbed_official | 27:3d32587bf8f7 | 115 | } |
| mbed_official | 101:1999b1beb68d | 116 | execute ("mbed compile --build out/${target}_${toolchain}_${configName}_${connectiontype}/ -m ${target} -t ${toolchain} -c --app-config ${config_file}") |
| mbed_official | 18:628e22df9c41 | 117 | } |
| mbed_official | 27:3d32587bf8f7 | 118 | archive '**/mbed-os-example-client.bin' |
| mbed_official | 36:bfb6816a677c | 119 | step([$class: 'WsCleanup']) |
| mbed_official | 18:628e22df9c41 | 120 | } |
| mbed_official | 18:628e22df9c41 | 121 | } |
| mbed_official | 18:628e22df9c41 | 122 | } |
| mbed_official | 18:628e22df9c41 | 123 | } |
Wiznet Wi-Fi WizFi310