Jenkinsfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. pipeline {
  2. agent none
  3. stages {
  4. stage('Build') {
  5. steps {
  6. script {
  7. def builds = [:]
  8. def docker_nuttx = "px4io/px4-dev-nuttx:2019-02-13"
  9. // stm32f4discovery
  10. // TODO: cxxtest, ipv6, netnsh, nxlines, rndis, testlibcxx, uavcan, usbmsc, winbuild
  11. for (def option in ["canard", "elf", "kostest", "nsh", "pm", "posix_spawn", "pseudoterm", "usbnsh", "xen1210"]) {
  12. def node_name = "stm32f4discovery/${option}"
  13. builds[node_name] = createBuildNode(docker_nuttx, "stm32f4discovery", option)
  14. }
  15. // stm32f103-minimum
  16. // TODO: jlx12864g
  17. for (def option in ["audio_tone", "buttons", "mcp2515", "nsh", "rfid-rc522", "rgbled", "usbnsh", "userled", "veml6070"]) {
  18. def node_name = "stm32f103-minimum/${option}"
  19. builds[node_name] = createBuildNode(docker_nuttx, "stm32f103-minimum", option)
  20. }
  21. // stm32f769i-disco
  22. for (def option in ["nsh", "netnsh"]) {
  23. def node_name = "stm32f769i-disco/${option}"
  24. builds[node_name] = createBuildNode(docker_nuttx, "stm32f769i-disco", option)
  25. }
  26. parallel builds
  27. } // script
  28. } // steps
  29. } // stage Builds
  30. }
  31. environment {
  32. CCACHE_DIR = '/tmp/ccache'
  33. }
  34. options {
  35. buildDiscarder(logRotator(numToKeepStr: '10'))
  36. timeout(time: 60, unit: 'MINUTES')
  37. }
  38. }
  39. def createBuildNode(String docker_repo, String board, String config) {
  40. return {
  41. node {
  42. docker.image(docker_repo).inside('-e CCACHE_BASEDIR=$WORKSPACE -v ${CCACHE_DIR}:${CCACHE_DIR}:rw') {
  43. stage("build") {
  44. sh('export')
  45. checkout scm
  46. sh('git clean -ff -x -d .')
  47. sh('ccache -z')
  48. sh('git clone --branch master --depth 1 https://github.com/PX4/NuttX-apps.git')
  49. sh('tools/configure.sh -l -a NuttX-apps ' + board + '/' + config)
  50. sh('make --no-print-directory --quiet')
  51. sh('ccache -s')
  52. sh('size nuttx')
  53. }
  54. }
  55. }
  56. }
  57. }