diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-12 18:50:12 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-12 22:08:49 +0100 |
commit | 1b58092a09a99fcb4bcc715b2ca1b0b28f9868dc (patch) | |
tree | 6f3cbaaa5c8450164286f19486f6e8256d3b480a /.travis/deploy.sh | |
parent | e3aa97f1059bce6e92572945661e6f6a5ed3cc97 (diff) | |
download | blogc-1b58092a09a99fcb4bcc715b2ca1b0b28f9868dc.tar.gz blogc-1b58092a09a99fcb4bcc715b2ca1b0b28f9868dc.tar.bz2 blogc-1b58092a09a99fcb4bcc715b2ca1b0b28f9868dc.zip |
travis: allow targets to disable deploy
Diffstat (limited to '.travis/deploy.sh')
-rwxr-xr-x | .travis/deploy.sh | 21 |
1 files changed, 16 insertions, 5 deletions
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 |