diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-13 20:22:51 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-03-13 20:22:51 +0100 |
commit | 3fe932d237e90a0beb8b1b5f1008d5cf0b9b4952 (patch) | |
tree | 3398a5147c0793054a72dcb81475c0e880708f7c /.travis/deploy.sh | |
parent | bc1c0a563edbaaa639ebd5741d3c0f8144e5bb8f (diff) | |
download | blogc-3fe932d237e90a0beb8b1b5f1008d5cf0b9b4952.tar.gz blogc-3fe932d237e90a0beb8b1b5f1008d5cf0b9b4952.tar.bz2 blogc-3fe932d237e90a0beb8b1b5f1008d5cf0b9b4952.zip |
travis: reworked test runner
Diffstat (limited to '.travis/deploy.sh')
-rwxr-xr-x | .travis/deploy.sh | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/.travis/deploy.sh b/.travis/deploy.sh deleted file mode 100755 index f04468c..0000000 --- a/.travis/deploy.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -set -e - -if [[ "x${TRAVIS_PULL_REQUEST}" != "xfalse" ]]; then - echo "This is a pull request. skipping deploy ..." - exit 0 -fi - -if [[ "x${TRAVIS_BRANCH}" != "xmaster" ]] && [[ "x${TRAVIS_TAG}" != xv* ]]; then - echo "This isn't master branch nor a valid tag. skipping deploy ..." - exit 0 -fi - -if [[ ! -d build ]]; then - echo "Build directory not found." - exit 1 -fi - -FILES= -if [[ -n "${TARGET}" ]] && [[ -e ".travis/targets/${TARGET}.sh" ]]; then - source ".travis/targets/${TARGET}.sh" -else - echo "Target not defined or invalid!" - exit 1 -fi - -if [[ "x$(type -t deploy)" != "xfunction" ]] || [[ "x$(type -t deploy_cond)" != "xfunction" ]]; then - echo "Nothing to deploy. skipping ..." - exit 0 -fi - -if ! deploy_cond; then - echo "Deploy disabled. skipping ..." - exit 0 -fi - -deploy - -TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)" -VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" - -do_sha512() { - pushd "$(dirname ${1})" > /dev/null - sha512sum "$(basename ${1})" - popd > /dev/null -} - -do_curl() { - curl \ - --silent \ - --form "project=${TARNAME}" \ - --form "version=${VERSION}" \ - --form "file=@${1}" \ - --form "sha512=$(do_sha512 ${1})" \ - "${DISTFILES_URL}" \ - &> /dev/null # make sure that we don't leak tokens -} - -echo " * Found files:" -for f in "${FILES[@]}"; do - echo " $(basename ${f})" -done -echo - -for f in "${FILES[@]}"; do - echo " * Processing file: $(basename ${f}):" - - echo -n " Uploading file ... " - do_curl "${f}" - echo "done" - - 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 |