This is a simple mbed client example demonstrating, registration of a device with mbed Device Connector and reading and writing values as well as deregistering on different Network Interfaces including Ethernet, WiFi, 6LoWPAN ND and Thread respectively.
Fork of mbed-os-example-client by
Jenkinsfile@18:628e22df9c41, 2016-09-21 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Sep 21 07:30:08 2016 +0100
- Revision:
- 18:628e22df9c41
- Child:
- 27:3d32587bf8f7
Merge pull request #82 from ARMmbed/jenkinsfile
Create Jenkinsfile
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 | 18:628e22df9c41 | 1 | // List of targets to compile |
mbed_official | 18:628e22df9c41 | 2 | def targets = [ |
mbed_official | 18:628e22df9c41 | 3 | "K64F" |
mbed_official | 18:628e22df9c41 | 4 | ] |
mbed_official | 18:628e22df9c41 | 5 | |
mbed_official | 18:628e22df9c41 | 6 | // Map toolchains to compilers |
mbed_official | 18:628e22df9c41 | 7 | def toolchains = [ |
mbed_official | 18:628e22df9c41 | 8 | ARM: "armcc", |
mbed_official | 18:628e22df9c41 | 9 | GCC_ARM: "arm-none-eabi-gcc", |
mbed_official | 18:628e22df9c41 | 10 | IAR: "iar_arm" |
mbed_official | 18:628e22df9c41 | 11 | ] |
mbed_official | 18:628e22df9c41 | 12 | |
mbed_official | 18:628e22df9c41 | 13 | def configurations = [ |
mbed_official | 18:628e22df9c41 | 14 | "default", |
mbed_official | 18:628e22df9c41 | 15 | "thread" |
mbed_official | 18:628e22df9c41 | 16 | ] |
mbed_official | 18:628e22df9c41 | 17 | |
mbed_official | 18:628e22df9c41 | 18 | def stepsForParallel = [:] |
mbed_official | 18:628e22df9c41 | 19 | |
mbed_official | 18:628e22df9c41 | 20 | // Jenkins pipeline does not support map.each, we need to use oldschool for loop |
mbed_official | 18:628e22df9c41 | 21 | for (int i = 0; i < targets.size(); i++) { |
mbed_official | 18:628e22df9c41 | 22 | for(int j = 0; j < toolchains.size(); j++) { |
mbed_official | 18:628e22df9c41 | 23 | for(int k = 0; k < configurations.size(); k++) { |
mbed_official | 18:628e22df9c41 | 24 | def target = targets.get(i) |
mbed_official | 18:628e22df9c41 | 25 | def toolchain = toolchains.keySet().asList().get(j) |
mbed_official | 18:628e22df9c41 | 26 | def compilerLabel = toolchains.get(toolchain) |
mbed_official | 18:628e22df9c41 | 27 | def config = configurations.get(k) |
mbed_official | 18:628e22df9c41 | 28 | |
mbed_official | 18:628e22df9c41 | 29 | def stepName = "${target} ${toolchain} ${config}" |
mbed_official | 18:628e22df9c41 | 30 | stepsForParallel[stepName] = buildStep(target, compilerLabel, toolchain, config) |
mbed_official | 18:628e22df9c41 | 31 | } |
mbed_official | 18:628e22df9c41 | 32 | } |
mbed_official | 18:628e22df9c41 | 33 | } |
mbed_official | 18:628e22df9c41 | 34 | |
mbed_official | 18:628e22df9c41 | 35 | timestamps { |
mbed_official | 18:628e22df9c41 | 36 | parallel stepsForParallel |
mbed_official | 18:628e22df9c41 | 37 | } |
mbed_official | 18:628e22df9c41 | 38 | |
mbed_official | 18:628e22df9c41 | 39 | def buildStep(target, compilerLabel, toolchain, configName) { |
mbed_official | 18:628e22df9c41 | 40 | return { |
mbed_official | 18:628e22df9c41 | 41 | stage ("${target}_${compilerLabel}_${configName}") { |
mbed_official | 18:628e22df9c41 | 42 | node ("${compilerLabel}") { |
mbed_official | 18:628e22df9c41 | 43 | deleteDir() |
mbed_official | 18:628e22df9c41 | 44 | dir("mbed-os-example-client") { |
mbed_official | 18:628e22df9c41 | 45 | checkout scm |
mbed_official | 18:628e22df9c41 | 46 | |
mbed_official | 18:628e22df9c41 | 47 | if ("${configName}" == "thread") { |
mbed_official | 18:628e22df9c41 | 48 | // Add IPV6 feature |
mbed_official | 18:628e22df9c41 | 49 | execute("sed -i 's/\"CLIENT\", \"COMMON_PAL\"/\"CLIENT\", \"IPV6\", \"COMMON_PAL\"/' mbed_app.json") |
mbed_official | 18:628e22df9c41 | 50 | // Change connection type to thread |
mbed_official | 18:628e22df9c41 | 51 | execute ("sed -i 's/\"value\": \"ETHERNET\"/\"value\": \"MESH_THREAD\"/' mbed_app.json") |
mbed_official | 18:628e22df9c41 | 52 | // Add atmel-rf-driver |
mbed_official | 18:628e22df9c41 | 53 | execute ("mbed add https://github.com/ARMmbed/atmel-rf-driver") |
mbed_official | 18:628e22df9c41 | 54 | } |
mbed_official | 18:628e22df9c41 | 55 | |
mbed_official | 18:628e22df9c41 | 56 | // Copy security.h to build |
mbed_official | 18:628e22df9c41 | 57 | mbed.getSecurityFile() |
mbed_official | 18:628e22df9c41 | 58 | |
mbed_official | 18:628e22df9c41 | 59 | execute ("mbed deploy --protocol ssh") |
mbed_official | 18:628e22df9c41 | 60 | execute ("mbed compile --build .build/${target}_${compilerLabel}_${configName}/ -m ${target} -t ${toolchain} -c") |
mbed_official | 18:628e22df9c41 | 61 | archive '**/mbed-os-example-client.bin' |
mbed_official | 18:628e22df9c41 | 62 | } |
mbed_official | 18:628e22df9c41 | 63 | } |
mbed_official | 18:628e22df9c41 | 64 | } |
mbed_official | 18:628e22df9c41 | 65 | } |
mbed_official | 18:628e22df9c41 | 66 | } |