From af7097688f5ced99dc174b296756dd05f2dd61da Mon Sep 17 00:00:00 2001 From: Paul Rogalinski Date: Tue, 31 Mar 2015 18:49:07 +0200 Subject: [PATCH] support for build artifact upload to a remote server --- .travis.sh | 23 ++++++++++++++++++++++- docs/development/Travis.md | 10 ++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 docs/development/Travis.md diff --git a/.travis.sh b/.travis.sh index 77a0820a4..ce6f73fa2 100755 --- a/.travis.sh +++ b/.travis.sh @@ -3,5 +3,26 @@ if [ $RUNTESTS ] ; then cd ./src/test && make test else - make -j2 + if [ $PUBLISH_URL ] ; then + + make -j2 + + TARGET_FILE=obj/cleanflight_${TARGET} + + if [ -f ${TARGET_FILE}.bin ]; + then + TARGET_FILE=${TARGET_FILE}.bin + elif [ -f ${TARGET_FILE}.hex ]; + then + TARGET_FILE=${TARGET_FILE}.hex + else + echo "build artifact (hex or bin) for ${TARGET_FILE} not found, aborting"; + exit 1 + fi + + curl -F file=@${TARGET_FILE} ${PUBLISH_URL} + else + make -j2 + fi + fi diff --git a/docs/development/Travis.md b/docs/development/Travis.md new file mode 100644 index 000000000..375a3425b --- /dev/null +++ b/docs/development/Travis.md @@ -0,0 +1,10 @@ +#Travis + +Cleanflight provides Travis build and config files in the repository root. + +## Pushing builds to a remote server + +```.travis.sh``` script can upload build artifacts to a remote server. This feature is controlled by the +```PUBLISH_URL``` environment variable. If set, the build script will use the cURL binary and simulate +a file upload post to the configured server. +