diff options
| author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-01-26 18:44:45 +0100 | 
|---|---|---|
| committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-01-26 18:46:58 +0100 | 
| commit | 3136151c657a696ed0937d0600284b2d137ad828 (patch) | |
| tree | 499ac963f47e0b3873025a50d5bbbcef27b7d673 /.travis | |
| parent | 758b0f711c496a1121061724573bb0eb816cd57b (diff) | |
| download | blogc-3136151c657a696ed0937d0600284b2d137ad828.tar.gz blogc-3136151c657a696ed0937d0600284b2d137ad828.tar.bz2 blogc-3136151c657a696ed0937d0600284b2d137ad828.zip  | |
travis: build: use new distfile deployment service
Diffstat (limited to '.travis')
| -rwxr-xr-x | .travis/deploy.sh | 26 | 
1 files changed, 12 insertions, 14 deletions
diff --git a/.travis/deploy.sh b/.travis/deploy.sh index 350a400..d9ccc0a 100755 --- a/.travis/deploy.sh +++ b/.travis/deploy.sh @@ -35,13 +35,21 @@ 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 \ -        --ftp-create-dirs \ -        --upload-file "${1}" \ -        --user "${FTP_USER}:${FTP_PASSWORD}" \ -        "ftp://${FTP_HOST}/public_html/${TARNAME}/${TARNAME}-${VERSION}/$(basename ${1})" +        --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:" @@ -53,19 +61,9 @@ echo  for f in "${FILES[@]}"; do      echo " * Processing file: $(basename ${f}):" -    echo -n "   Generating SHA512 checksum ... " -    pushd "$(dirname ${f})" > /dev/null -    sha512sum "$(basename ${f})" > "$(basename ${f}).sha512" -    popd > /dev/null -    echo "done" -      echo -n "   Uploading file ... "      do_curl "${f}"      echo "done" -    echo -n "   Uploading SHA512 checksum ... " -    do_curl "${f}.sha512" -    echo "done" -      echo  done  | 
