Jenkinsfile 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. pipeline {
  2. agent {
  3. docker {
  4. image 'ubuntu_ci:latest'
  5. }
  6. }
  7. stages {
  8. stage('build') {
  9. steps {
  10. sh '''
  11. uname -a
  12. cat /etc/issue
  13. apt-get update
  14. apt-get install -y -qq lib32ncurses5 lib32z1 > /dev/null
  15. curl -s http://download.isrc.rt-thread.com/download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 | sudo tar xjf - -C /opt
  16. /opt/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-gcc --version
  17. '''
  18. script {
  19. def bsp_array = [
  20. ['CME_M7', 'sourcery-arm'],
  21. // ['apollo2', 'sourcery-arm'], /* CI compile not support */
  22. ['asm9260t', 'sourcery-arm'],
  23. ['at91sam9260', 'sourcery-arm'],
  24. ['allwinner_tina', 'sourcery-arm'],
  25. ['efm32', 'sourcery-arm'],
  26. // ['gd32e230k-start', 'sourcery-arm'], /* CI compile not support */
  27. ['gd32303e-eval', 'sourcery-arm'],
  28. // ['gd32450z-eval', 'sourcery-arm'], /* CI link not support */
  29. ['imx6sx/cortex-a9', 'sourcery-arm'],
  30. // ['imxrt/imxrt1052-atk-commander', 'sourcery-arm'], /* CI compile not support */
  31. // ['imxrt/imxrt1052-fire-pro', 'sourcery-arm'], /* CI compile not support */
  32. // ['imxrt/imxrt1052-nxp-evk', 'sourcery-arm'], /* CI compile not support */
  33. ['lm3s8962', 'sourcery-arm'],
  34. ['lm3s9b9x', 'sourcery-arm'],
  35. ['lm4f232', 'sourcery-arm'],
  36. ['tm4c129x', 'sourcery-arm'],
  37. // ['lpc43xx/M4', 'sourcery-arm'], /* CI compile not support */
  38. ['lpc176x', 'sourcery-arm'],
  39. ['lpc178x', 'sourcery-arm'],
  40. ['lpc408x', 'sourcery-arm'],
  41. ['lpc1114', 'sourcery-arm'],
  42. ['lpc2148', 'sourcery-arm'],
  43. ['lpc2478', 'sourcery-arm'],
  44. ['lpc5410x', 'sourcery-arm'],
  45. // ['lpc54114-lite', 'sourcery-arm'], /* CI link not support */
  46. ['mb9bf500r', 'sourcery-arm'],
  47. ['mb9bf506r', 'sourcery-arm'],
  48. ['mb9bf618s', 'sourcery-arm'],
  49. ['mb9bf568r', 'sourcery-arm'],
  50. ['mini2440', 'sourcery-arm'],
  51. ['nuvoton_nuc472', 'sourcery-arm'],
  52. ['nuvoton_m05x', 'sourcery-arm'],
  53. ['qemu-vexpress-a9', 'sourcery-arm'],
  54. ['qemu-vexpress-gemini', 'sourcery-arm'],
  55. ['sam7x', 'sourcery-arm'],
  56. // ['stm32/stm32f072-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  57. // ['stm32/stm32f091-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  58. // ['stm32/stm32f103-atk-nano', 'sourcery-arm'], /* CI compile C99 not support */
  59. // ['stm32/stm32f103-atk-warshipv3', 'sourcery-arm'], /* CI compile C99 not support */
  60. // ['stm32/stm32f103-dofly-lyc8', 'sourcery-arm'], /* CI compile C99 not support */
  61. // ['stm32/stm32f103-dofly-M3S', 'sourcery-arm'], /* CI compile C99 not support */
  62. // ['stm32/stm32f103-fire-arbitrary', 'sourcery-arm'], /* CI compile C99 not support */
  63. // ['stm32/stm32f103-hw100k-ibox', 'sourcery-arm'], /* CI compile C99 not support */
  64. // ['stm32/stm32f103-mini-system', 'sourcery-arm'], /* CI compile C99 not support */
  65. // ['stm32/stm32f103-onenet-nbiot', 'sourcery-arm'], /* CI compile C99 not support */
  66. // ['stm32/stm32f103-yf-ufun', 'sourcery-arm'], /* CI compile C99 not support */
  67. // ['stm32/stm32f107-uc-eval', 'sourcery-arm'], /* CI compile C99 not support */
  68. // ['stm32/stm32f401-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  69. // ['stm32/stm32f405-smdz-breadfruit', 'sourcery-arm'], /* CI compile C99 not support */
  70. // ['stm32/stm32f407-atk-explorer', 'sourcery-arm'], /* CI compile C99 not support */
  71. // ['stm32/stm32f407-st-discovery', 'sourcery-arm'], /* CI compile C99 not support */
  72. // ['stm32/stm32f410-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  73. // ['stm32/stm32f411-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  74. // ['stm32/stm32f411-weact-MiniF4', 'sourcery-arm'], /* CI compile C99 not support */
  75. // ['stm32/stm32f413-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  76. // ['stm32/stm32f427-robomaster-a', 'sourcery-arm'], /* CI compile C99 not support */
  77. // ['stm32/stm32f429-armfly-v6', 'sourcery-arm'], /* CI compile C99 not support */
  78. // ['stm32/stm32f429-atk-apollo', 'sourcery-arm'], /* CI compile C99 not support */
  79. // ['stm32/stm32f429-fire-challenger', 'sourcery-arm'], /* CI compile C99 not support */
  80. // ['stm32/stm32f429-st-disco', 'sourcery-arm'], /* CI compile C99 not support */
  81. // ['stm32/stm32f446-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  82. // ['stm32/stm32f469-st-disco', 'sourcery-arm'], /* CI compile C99 not support */
  83. // ['stm32/stm32f746-st-disco', 'sourcery-arm'], /* CI compile -mcpu= not support */
  84. // ['stm32/stm32f767-atk-apollo', 'sourcery-arm'], /* CI compile -mcpu= not support */
  85. // ['stm32/stm32f767-fire-challenger', 'sourcery-arm'], /* CI compile -mcpu= not support */
  86. // ['stm32/stm32f767-st-nucleo', 'sourcery-arm'], /* CI compile -mcpu= not support */
  87. // ['stm32/stm32g071-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  88. // ['stm32/stm32g431-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  89. // ['stm32/stm32h743-atk-apollo', 'sourcery-arm'], /* CI compile -mcpu= not support */
  90. // ['stm32/stm32h743-st-nucleo', 'sourcery-arm'], /* CI compile -mcpu= not support */
  91. // ['stm32/stm32h747-st-discovery', 'sourcery-arm'], /* CI compile -mcpu= not support */
  92. // ['stm32/stm32l4r9-st-eval', 'sourcery-arm'], /* CI compile C99 not support */
  93. // ['stm32/stm32l010-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  94. // ['stm32/stm32l053-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  95. // ['stm32/stm32l412-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  96. // ['stm32/stm32l432-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  97. // ['stm32/stm32l433-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  98. // ['stm32/stm32l475-atk-pandora', 'sourcery-arm'], /* CI compile C99 not support */
  99. // ['stm32/stm32l475-st-discovery', 'sourcery-arm'], /* CI compile C99 not support */
  100. // ['stm32/stm32l476-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  101. // ['stm32/stm32l496-ali-developer', 'sourcery-arm'], /* CI compile C99 not support */
  102. // ['stm32/stm32l496-st-nucleo', 'sourcery-arm'], /* CI compile C99 not support */
  103. ['stm32f20x', 'sourcery-arm'],
  104. ['swm320-lq100', 'sourcery-arm'],
  105. ['beaglebone', 'sourcery-arm'],
  106. ['frdm-k64f', 'sourcery-arm'],
  107. ['xplorer4330/M4', 'sourcery-arm'],
  108. // ['at32/at32f403a-start', 'sourcery-arm'],/* CI link not support */
  109. // ['at32/at32f407-start', 'sourcery-arm']/* CI compile C99 not support */
  110. ]
  111. for (int i in bsp_array) {
  112. sh """
  113. export RTT_BSP=${i.getAt(0)}
  114. export RTT_TOOL_CHAIN=${i.getAt(1)}
  115. export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-5_4-2016q3/bin/
  116. export RTT_CC='gcc'
  117. export RTT_ROOT=`pwd`
  118. echo \$RTT_EXEC_PATH
  119. export CPUS=\$(cat /proc/cpuinfo | grep "processor" | sort | uniq | wc -l)
  120. scons -j\${CPUS} -C bsp/\$RTT_BSP
  121. """
  122. }
  123. }
  124. }
  125. }
  126. }
  127. post {
  128. failure {
  129. addGiteeMRComment(comment: """:x: Jenkins CI 构建失败。\n\n \
  130. 查看更多日志详细信息: \
  131. <a href="${env.RUN_DISPLAY_URL}">Jenkins[${env.JOB_NAME} # ${env.BUILD_NUMBER}]</a> \
  132. <hr /> \
  133. :x: The Jenkins CI build failed.\n\n \
  134. Results available at: \
  135. <a href="${env.RUN_DISPLAY_URL}">Jenkins[${env.JOB_NAME} # ${env.BUILD_NUMBER}]</a>""")
  136. }
  137. success {
  138. addGiteeMRComment(comment: """:white_check_mark: Jenkins CI 构建通过。\n\n \
  139. 查看更多日志详细信息: \
  140. <a href="${env.RUN_DISPLAY_URL}">Jenkins[${env.JOB_NAME} # ${env.BUILD_NUMBER}]</a> \
  141. <hr /> \
  142. :white_check_mark: The Jenkins CI build passed.\n\n \
  143. Results available at: \
  144. <a href="${env.RUN_DISPLAY_URL}">Jenkins[${env.JOB_NAME} # ${env.BUILD_NUMBER}]</a>""")
  145. }
  146. }
  147. }