1010 sh ' git clone --depth=1 --recursive -b master https://github.com/pycom/pycom-esp-idf.git esp-idf'
1111 }
1212
13- PYCOM_VERSION = get_version()
14- GIT_TAG = sh (script : ' git rev-parse --short HEAD' , returnStdout : true ). trim()
13+ PYCOM_VERSION = get_version()
14+ GIT_TAG = sh (script : ' git rev-parse --short HEAD' , returnStdout : true ). trim()
1515
1616 stage(' mpy-cross' ) {
1717 // build the cross compiler first
@@ -21,14 +21,13 @@ node {
2121 make all'''
2222 }
2323
24- stage(' firmware-build' ) {
25- def parallelSteps = [:]
26- for (board in boards_to_build) {
27- def board_u = board. toUpperCase()
28- parallelSteps[board] = boardBuild(board)
29- }
30- parallel parallelSteps
31- }
24+ for (board in boards_to_build) {
25+ stage(board) {
26+ def parallelSteps = [:]
27+ parallelSteps[board] = boardBuild(board)
28+ parallel parallelSteps
29+ }
30+ }
3231
3332 stash includes : ' **/*.bin' , name : ' binary'
3433 stash includes : ' tests/**' , name : ' tests'
@@ -38,19 +37,19 @@ node {
3837}
3938
4039stage (' Flash' ) {
41- def parallelFlash = [:]
42- for (board in boards_to_test) {
43- parallelFlash[board] = flashBuild(board)
44- }
45- parallel parallelFlash
40+ def parallelFlash = [:]
41+ for (board in boards_to_test) {
42+ parallelFlash[board] = flashBuild(board)
43+ }
44+ parallel parallelFlash
4645}
4746
4847stage (' Test' ){
49- def parallelTests = [:]
50- for (board in boards_to_test) {
51- parallelTests[board] = testBuild(board)
52- }
53- parallel parallelTests
48+ def parallelTests = [:]
49+ for (board in boards_to_test) {
50+ parallelTests[board] = testBuild(board)
51+ }
52+ parallel parallelTests
5453}
5554
5655
@@ -59,7 +58,7 @@ def boardBuild(name) {
5958 def name_short = name_u. split(' _' )[0 ]
6059 def app_bin = name. toLowerCase() + ' .bin'
6160 return {
62- release_dir = " ${ JENKINS_HOME} /release/${ JOB_NAME} /" + PYCOM_VERSION + " /" + GIT_TAG + " /"
61+ release_dir = " ${ JENKINS_HOME} /release/${ JOB_NAME} /" + PYCOM_VERSION + " /" + GIT_TAG + " /"
6362 sh ''' export PATH=$PATH:/opt/xtensa-esp32-elf/bin;
6463 export IDF_PATH=${WORKSPACE}/esp-idf;
6564 cd esp32;
@@ -101,7 +100,7 @@ def flashBuild(short_name) {
101100 unstash ' tests'
102101 unstash ' tools'
103102 sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
104- sh ' esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port ' + device_name + ' --baud 921600 erase_flash'
103+ sh ' esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port ' + device_name + ' --baud 921600 --before no_reset --after no_reset erase_flash'
105104 sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
106105 sh ' esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port ' + device_name + ' --baud 921600 --before no_reset --after no_reset write_flash -pz --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 esp32/build/' + board_name_u + ' /release/bootloader/bootloader.bin 0x8000 esp32/build/' + board_name_u + ' /release/lib/partitions.bin 0x10000 esp32/build/' + board_name_u + ' /release/' + board_name_u. toLowerCase() + ' .bin'
107106 sh ' python esp32/tools/pypic.py --port ' + device_name + ' --exit'
@@ -113,17 +112,17 @@ def testBuild(short_name) {
113112 return {
114113 String device_name = get_device_name(short_name)
115114 String board_name_u = get_firmware_name(short_name)
116- node(get_remote_name(short_name)) {
117- sleep(5 ) // Delay to skip all bootlog
118- dir(' tests' ) {
119- timeout(30 ) {
120- // As some tests are randomly failing... enforce script always returns 0 (OK)
121- sh ' ./run-tests --target=esp32-' + board_name_u + ' --device ' + device_name + ' || exit 0'
122- }
123- }
124- sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
125- sh ' python esp32/tools/pypic.py --port ' + device_name + ' --exit'
126- }
115+ node(get_remote_name(short_name)) {
116+ sleep(5 ) // Delay to skip all bootlog
117+ dir(' tests' ) {
118+ timeout(30 ) {
119+ // As some tests are randomly failing... enforce script always returns 0 (OK)
120+ sh ' ./run-tests --target=esp32-' + board_name_u + ' --device ' + device_name + ' || exit 0'
121+ }
122+ }
123+ sh ' python esp32/tools/pypic.py --port ' + device_name + ' --enter'
124+ sh ' python esp32/tools/pypic.py --port ' + device_name + ' --exit'
125+ }
127126 }
128127}
129128
@@ -134,16 +133,16 @@ def get_version() {
134133
135134def get_firmware_name (short_name ) {
136135 node {
137- def node_info = sh (script : ' cat ${JENKINS_HOME}/pycom-ic.conf || exit 0' , returnStdout : true ). trim()
138- def matcher = node_info =~ short_name + ' :(.+):.*'
136+ def node_info = sh (script : ' cat ${JENKINS_HOME}/pycom-ic.conf || exit 0' , returnStdout : true ). trim()
137+ def matcher = node_info =~ short_name + ' :(.+):.*'
139138 matcher ? matcher[0 ][1 ] : " WIPY"
140139 }
141140}
142141
143142def get_remote_name (short_name ) {
144143 node {
145- def node_info = sh (script : ' cat ${JENKINS_HOME}/pycom-ic.conf || exit 0' , returnStdout : true ). trim()
146- def matcher = node_info =~ short_name + ' :.*:(.+)'
144+ def node_info = sh (script : ' cat ${JENKINS_HOME}/pycom-ic.conf || exit 0' , returnStdout : true ). trim()
145+ def matcher = node_info =~ short_name + ' :.*:(.+)'
147146 matcher ? matcher[0 ][1 ] : " RPI3"
148147 }
149148}
0 commit comments