tools: Always upload to Rosie from Travis. (#200)

This allows Rosie to automatically work for commits to forks.
This commit is contained in:
Scott Shawcroft 2017-08-23 12:22:08 -07:00 committed by GitHub
parent 74cfdeb316
commit 774bf0cf0a
2 changed files with 11 additions and 6 deletions

View File

@ -6,7 +6,7 @@ binaries:
bucket: adafruit-circuit-python
file_pattern: bin/{board}/adafruit-circuitpython-{board}-*-{short_sha}.{extension}
rosie_upload:
file_pattern: adafruit-circuitpython-{board}-{short_sha}.{extension}
file_pattern: adafruit-circuitpython-{board}*{short_sha}.{extension}
circuitpython_tests:
test_directories:

View File

@ -18,8 +18,13 @@ if [ $? -ne 0 ]; then
version=`date +%Y%m%d`-`git rev-parse --short HEAD`
fi
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
version=`echo $TRAVIS_PULL_REQUEST_SHA | cut -c1-7`
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
fi
for board in $ATMEL_BOARDS; do
@ -29,10 +34,10 @@ for board in $ATMEL_BOARDS; do
cp atmel-samd/build-$board/firmware.uf2 bin/$board/adafruit-circuitpython-$board-$version.uf2
(( exit_status = exit_status || $? ))
# Only upload to Rosie if its a pull request.
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "$TRAVIS" == "true" ]; then
for rosie in $ROSIE_SETUPS; do
echo "Uploading to https://$rosie.ngrok.io/upload/$TRAVIS_PULL_REQUEST_SHA"
curl -F "file=@bin/$board/adafruit-circuitpython-$board-$version.uf2" https://$rosie.ngrok.io/upload/$TRAVIS_PULL_REQUEST_SHA
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
done
fi
done