2017-10-24 23:06:02 -07:00
|
|
|
rm -rf ports/atmel-samd/build*
|
|
|
|
rm -rf ports/esp8266/build*
|
2017-12-27 13:54:16 +01:00
|
|
|
rm -rf ports/nrf/build*
|
2016-11-21 14:40:28 -08:00
|
|
|
|
2018-01-19 11:53:47 -08:00
|
|
|
ATMEL_BOARDS="arduino_zero circuitplayground_express feather_m0_basic feather_m0_adalogger itsybitsy_m0 feather_m0_rfm69 feather_m0_rfm9x feather_m0_express metro_m0_express metro_m4_express trinket_m0 gemma_m0 feather52"
|
2017-08-15 15:45:27 -07:00
|
|
|
ROSIE_SETUPS="rosie-ci"
|
2016-11-29 10:47:11 -08:00
|
|
|
|
2017-10-24 23:06:02 -07:00
|
|
|
PARALLEL="-j 5"
|
|
|
|
if [ "$TRAVIS" == "true" ]; then
|
|
|
|
PARALLEL="-j 2"
|
|
|
|
fi
|
|
|
|
|
2017-11-15 15:05:34 -08:00
|
|
|
if [ -z "$TRAVIS_BOARD" ]; then
|
|
|
|
boards=$ATMEL_BOARDS
|
|
|
|
else
|
|
|
|
boards=$TRAVIS_BOARD
|
|
|
|
fi
|
|
|
|
|
|
|
|
for board in $boards; do
|
2017-12-28 22:35:03 +01:00
|
|
|
if [ $board == "feather52" ]; then
|
|
|
|
make $PARALLEL -C ports/nrf BOARD=feather52
|
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
else
|
|
|
|
make $PARALLEL -C ports/atmel-samd BOARD=$board
|
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
fi
|
2016-11-29 10:47:11 -08:00
|
|
|
done
|
2017-05-01 14:40:50 -07:00
|
|
|
if [ -z "$TRAVIS" ]; then
|
2017-10-24 23:06:02 -07:00
|
|
|
make $PARALLEL -C ports/esp8266 BOARD=feather_huzzah
|
2017-04-20 15:14:37 -07:00
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
fi
|
2016-11-21 14:40:28 -08:00
|
|
|
|
|
|
|
version=`git describe --tags --exact-match`
|
|
|
|
if [ $? -ne 0 ]; then
|
2017-04-20 14:04:06 -07:00
|
|
|
version=`date +%Y%m%d`-`git rev-parse --short HEAD`
|
2016-11-21 14:40:28 -08:00
|
|
|
fi
|
|
|
|
|
2017-08-23 12:22:08 -07:00
|
|
|
|
|
|
|
if [ "$TRAVIS" == "true" ]; then
|
|
|
|
sha=$TRAVIS_COMMIT
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
|
|
version=`date +%Y%m%d`-`echo $TRAVIS_PULL_REQUEST_SHA | cut -c1-7`
|
|
|
|
sha=$TRAVIS_PULL_REQUEST_SHA
|
|
|
|
fi
|
2017-08-15 15:45:27 -07:00
|
|
|
fi
|
|
|
|
|
2017-11-15 15:05:34 -08:00
|
|
|
for board in $boards; do
|
2017-04-20 14:04:06 -07:00
|
|
|
mkdir -p bin/$board/
|
2017-12-28 22:35:03 +01:00
|
|
|
if [ $board == "feather52" ]; then
|
2018-01-15 19:11:35 +01:00
|
|
|
cp ports/nrf/build-$board-s132/firmware.bin bin/$board/adafruit-circuitpython-$board-$version.bin
|
2017-12-28 22:35:03 +01:00
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
else
|
|
|
|
cp ports/atmel-samd/build-$board/firmware.bin bin/$board/adafruit-circuitpython-$board-$version.bin
|
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
cp ports/atmel-samd/build-$board/firmware.uf2 bin/$board/adafruit-circuitpython-$board-$version.uf2
|
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
fi
|
2017-08-15 15:45:27 -07:00
|
|
|
# Only upload to Rosie if its a pull request.
|
2017-08-23 12:22:08 -07:00
|
|
|
if [ "$TRAVIS" == "true" ]; then
|
2017-08-15 15:45:27 -07:00
|
|
|
for rosie in $ROSIE_SETUPS; do
|
2017-08-23 12:22:08 -07:00
|
|
|
echo "Uploading to https://$rosie.ngrok.io/upload/$sha"
|
|
|
|
curl -F "file=@bin/$board/adafruit-circuitpython-$board-$version.uf2" https://$rosie.ngrok.io/upload/$sha
|
2017-08-15 15:45:27 -07:00
|
|
|
done
|
|
|
|
fi
|
2016-11-29 10:47:11 -08:00
|
|
|
done
|
2017-04-20 15:14:37 -07:00
|
|
|
|
|
|
|
# Skip ESP8266 on Travis
|
2017-05-01 14:40:50 -07:00
|
|
|
if [ -z "$TRAVIS" ]; then
|
2017-04-20 15:14:37 -07:00
|
|
|
mkdir -p bin/esp8266/
|
2017-10-24 23:06:02 -07:00
|
|
|
cp ports/esp8266/build/firmware-combined.bin bin/esp8266/adafruit-circuitpython-feather_huzzah-$version.bin
|
2017-04-20 15:14:37 -07:00
|
|
|
(( exit_status = exit_status || $? ))
|
|
|
|
fi
|
2017-04-20 14:04:06 -07:00
|
|
|
|
|
|
|
exit $exit_status
|