From 1b58092a09a99fcb4bcc715b2ca1b0b28f9868dc Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Mon, 12 Mar 2018 18:50:12 +0100 Subject: travis: allow targets to disable deploy --- .travis/deploy.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to '.travis/deploy.sh') diff --git a/.travis/deploy.sh b/.travis/deploy.sh index d9ccc0a..c002b35 100755 --- a/.travis/deploy.sh +++ b/.travis/deploy.sh @@ -12,11 +12,6 @@ if [[ "x${TRAVIS_BRANCH}" != "xmaster" ]] && [[ "x${TRAVIS_TAG}" != xv* ]]; then exit 0 fi -if [[ "x${CC}" != "xgcc" ]] || [[ "x${TARGET}" = "xvalgrind" ]] || [[ "x${TARGET}" = "xmake-embedded" ]]; then - echo "Invalid target for deploy. skipping ..." - exit 0 -fi - if [[ ! -d build ]]; then echo "Build directory not found." exit 1 @@ -30,6 +25,16 @@ else exit 1 fi +if [[ "x$(type -t deploy)" != "xfunction" ]] || [[ "x$(type -t deploy_condition)" != "xfunction" ]]; then + echo "Nothing to deploy. skipping ..." + exit 1 +fi + +if ! deploy_condition; then + echo "Deploy disabled. skipping ..." + exit 1 +fi + deploy TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)" @@ -67,3 +72,9 @@ for f in "${FILES[@]}"; do echo done + +# this is a hack to allow failed tests to upload files. +# the target must write status code to build/.test_result, instead of exiting directly +if [[ -f build/.test_result ]]; then + exit $(cat build/.test_result) +fi -- cgit v1.2.3-18-g5258