mbed-os-examples / Mbed OS nanostack-border-router-mbed5
Committer:
mbed_official
Date:
Fri Nov 23 14:45:35 2018 +0000
Revision:
82:3d9e3b7b3dcf
Parent:
77:2d8a3de185b7
Child:
92:7faf6dcb791f
Merge pull request #147 from ARMmbed/br_update

Update Border router
.
Commit copied from https://github.com/ARMmbed/nanostack-border-router

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 31:11a6bfef0d31 1 properties ([[$class: 'ParametersDefinitionProperty', parameterDefinitions: [
mbed_official 82:3d9e3b7b3dcf 2 [$class: 'StringParameterDefinition', name: 'mbed_os_revision', defaultValue: '', description: 'Revision of mbed-os to build. By default mbed-os.lib is used. To access mbed-os PR use format "pull/PR number/head"'],
mbed_official 82:3d9e3b7b3dcf 3 [$class: 'ChoiceParameterDefinition', name: 'profile', defaultValue: "debug", choices: ["debug", "develop", "release"], description: 'Select compilation profile from list: debug, develop or release.']
mbed_official 31:11a6bfef0d31 4 ]]])
mbed_official 31:11a6bfef0d31 5
mbed_official 31:11a6bfef0d31 6 if (params.mbed_os_revision == '') {
mbed_official 31:11a6bfef0d31 7 echo 'Use mbed OS revision from mbed-os.lib'
mbed_official 31:11a6bfef0d31 8 } else {
mbed_official 31:11a6bfef0d31 9 echo "Use mbed OS revision ${params.mbed_os_revision}"
mbed_official 31:11a6bfef0d31 10 if (params.mbed_os_revision.matches('pull/\\d+/head')) {
mbed_official 31:11a6bfef0d31 11 echo "Revision is a Pull Request"
mbed_official 31:11a6bfef0d31 12 }
mbed_official 31:11a6bfef0d31 13 }
mbed_official 31:11a6bfef0d31 14
mbed_official 82:3d9e3b7b3dcf 15 echo "Use build profile: ${params.profile}"
mbed_official 82:3d9e3b7b3dcf 16
mbed_official 0:85f4174a8e29 17 // List of targets to compile
mbed_official 0:85f4174a8e29 18 def targets = [
mbed_official 6:3c1f873ebe0b 19 "K64F",
mbed_official 69:a8a0ac9f3f8a 20 "K66F",
mbed_official 69:a8a0ac9f3f8a 21 "NUCLEO_F429ZI"
mbed_official 0:85f4174a8e29 22 ]
mbed_official 0:85f4174a8e29 23
mbed_official 43:49df70842a8a 24 // Map toolchains to CI labels
mbed_official 0:85f4174a8e29 25 def toolchains = [
mbed_official 0:85f4174a8e29 26 ARM: "armcc",
mbed_official 77:2d8a3de185b7 27 // ARMC6: "armc6",
mbed_official 0:85f4174a8e29 28 GCC_ARM: "arm-none-eabi-gcc",
mbed_official 43:49df70842a8a 29 IAR: "iar_arm"
mbed_official 0:85f4174a8e29 30 ]
mbed_official 0:85f4174a8e29 31
mbed_official 0:85f4174a8e29 32 // Configurations
mbed_official 0:85f4174a8e29 33 def configurations = [
mbed_official 0:85f4174a8e29 34 LOWPAN: "6lowpan_Atmel_RF.json",
mbed_official 0:85f4174a8e29 35 THREAD: "Thread_Atmel_RF.json",
mbed_official 0:85f4174a8e29 36 THREAD_SLIP: "Thread_SLIP_Atmel_RF.json"
mbed_official 0:85f4174a8e29 37 ]
mbed_official 0:85f4174a8e29 38
mbed_official 0:85f4174a8e29 39 def stepsForParallel = [:]
mbed_official 0:85f4174a8e29 40
mbed_official 0:85f4174a8e29 41 // Jenkins pipeline does not support map.each, we need to use oldschool for loop
mbed_official 0:85f4174a8e29 42 for (int i = 0; i < targets.size(); i++) {
mbed_official 0:85f4174a8e29 43 for(int j = 0; j < toolchains.size(); j++) {
mbed_official 0:85f4174a8e29 44 for(int k = 0; k < configurations.size(); k++) {
mbed_official 0:85f4174a8e29 45 def target = targets.get(i)
mbed_official 0:85f4174a8e29 46 def toolchain = toolchains.keySet().asList().get(j)
mbed_official 0:85f4174a8e29 47 def compilerLabel = toolchains.get(toolchain)
mbed_official 0:85f4174a8e29 48 def configurationLabel = configurations.keySet().asList().get(k)
mbed_official 0:85f4174a8e29 49 def configurationFile = configurations.get(configurationLabel)
mbed_official 0:85f4174a8e29 50 def stepName = "${target} ${configurationLabel} ${toolchain}"
mbed_official 17:fbeba6669995 51 // SLIP configuration exist only for K64F based Raspberry HAT
mbed_official 17:fbeba6669995 52 if (configurationLabel == "THREAD_SLIP" && target != "K64F") {
mbed_official 17:fbeba6669995 53 continue;
mbed_official 17:fbeba6669995 54 }
mbed_official 0:85f4174a8e29 55 stepsForParallel[stepName] = buildStep(target, compilerLabel, configurationFile, configurationLabel, toolchain)
mbed_official 0:85f4174a8e29 56 }
mbed_official 0:85f4174a8e29 57 }
mbed_official 0:85f4174a8e29 58 }
mbed_official 0:85f4174a8e29 59
mbed_official 0:85f4174a8e29 60 timestamps {
mbed_official 0:85f4174a8e29 61 parallel stepsForParallel
mbed_official 0:85f4174a8e29 62 }
mbed_official 0:85f4174a8e29 63
mbed_official 0:85f4174a8e29 64 def buildStep(target, compilerLabel, configurationFile, configurationLabel, toolchain) {
mbed_official 0:85f4174a8e29 65 return {
mbed_official 0:85f4174a8e29 66 stage ("${target}_${compilerLabel}_${configurationLabel}") {
mbed_official 0:85f4174a8e29 67 node ("${compilerLabel}") {
mbed_official 0:85f4174a8e29 68 deleteDir()
mbed_official 0:85f4174a8e29 69 dir("nanostack-border-router") {
mbed_official 0:85f4174a8e29 70 checkout scm
mbed_official 0:85f4174a8e29 71 execute("mbed deploy --protocol ssh")
mbed_official 31:11a6bfef0d31 72 // Update mbed-os revision if requested
mbed_official 31:11a6bfef0d31 73 if (params.mbed_os_revision != '') {
mbed_official 31:11a6bfef0d31 74 dir ("mbed-os") {
mbed_official 31:11a6bfef0d31 75 if (params.mbed_os_revision.matches('pull/\\d+/head')) {
mbed_official 31:11a6bfef0d31 76 execute("git fetch origin ${params.mbed_os_revision}:_PR_")
mbed_official 31:11a6bfef0d31 77 execute("git checkout _PR_")
mbed_official 31:11a6bfef0d31 78 } else {
mbed_official 31:11a6bfef0d31 79 execute ("git checkout ${params.mbed_os_revision}")
mbed_official 31:11a6bfef0d31 80 }
mbed_official 31:11a6bfef0d31 81 }
mbed_official 31:11a6bfef0d31 82 }
mbed_official 82:3d9e3b7b3dcf 83 execute("mbed compile --build out/${configurationLabel}/${target}/${toolchain}/ -m ${target} -t ${toolchain} --app-config ./configs/${configurationFile} --profile ${params.profile}")
mbed_official 0:85f4174a8e29 84 }
mbed_official 0:85f4174a8e29 85 archive '**/nanostack-border-router.bin'
mbed_official 0:85f4174a8e29 86 }
mbed_official 0:85f4174a8e29 87 }
mbed_official 0:85f4174a8e29 88 }
mbed_official 0:85f4174a8e29 89 }