From 214d09891909ce5505d7bdbc5c848a9c4be23c0d Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 8 Mar 2016 20:33:21 +0100 Subject: travis: added script to upload distfiles --- build-aux/travis-deploy.sh | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 build-aux/travis-deploy.sh (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh new file mode 100755 index 0000000..267c8d5 --- /dev/null +++ b/build-aux/travis-deploy.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -e + +if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]]; then + echo "Nothing to deploy." + exit 0 +fi + +if [[ ! -d build ]]; then + echo "Build directory not found." + exit 1 +fi + +if [[ "x${TARGET}" = xw* ]]; then + FILES=( build/*.zip ) +elif [[ "x${TARGET}" = "xdist-srpm" ]]; then + FILES=( build/*.src.rpm ) +else + FILES=( build/*.{*.tar.{gz,bz2,xz},zip} ) +fi + +TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)" +VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" + +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})" +} + +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 " Generating SHA512 checksum ... " + pushd build > /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 -- cgit v1.2.3-18-g5258 From b8206af55ad7143fecb8c82e549571466b53680f Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 8 Mar 2016 23:44:04 +0100 Subject: travis: temporary remove --silent from curl call --- build-aux/travis-deploy.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index 267c8d5..a959ccb 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -25,7 +25,6 @@ VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" do_curl() { curl \ - --silent \ --ftp-create-dirs \ --upload-file "${1}" \ --user "${FTP_USER}:${FTP_PASSWORD}" \ -- cgit v1.2.3-18-g5258 From 847aab8299bcff9d259aa5b6eb4686ae4f2fb763 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 9 Mar 2016 00:10:36 +0100 Subject: travis: optimize --- build-aux/travis-deploy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index a959ccb..65f162e 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -2,7 +2,7 @@ set -e -if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]]; then +if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]] && [[ "x${CC}" != xgcc ]]; then echo "Nothing to deploy." exit 0 fi @@ -25,6 +25,7 @@ VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)" do_curl() { curl \ + --silent \ --ftp-create-dirs \ --upload-file "${1}" \ --user "${FTP_USER}:${FTP_PASSWORD}" \ -- cgit v1.2.3-18-g5258 From 70f1a705c4b12486dd75a4f61aeae730772b5e84 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 9 Mar 2016 00:22:41 +0100 Subject: travis: optimize --- build-aux/travis-deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index 65f162e..267c8d5 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -2,7 +2,7 @@ set -e -if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]] && [[ "x${CC}" != xgcc ]]; then +if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]]; then echo "Nothing to deploy." exit 0 fi -- cgit v1.2.3-18-g5258 From 3ead966f48bc47444d7ec72f46e94e73557695a5 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 9 Mar 2016 22:22:48 +0100 Subject: travis: improved deploy conditions --- build-aux/travis-deploy.sh | 5 ----- 1 file changed, 5 deletions(-) (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index 267c8d5..71469ff 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -2,11 +2,6 @@ set -e -if [[ "x${TARGET}" != xw* ]] && [[ "x${TARGET}" != xdist* ]]; then - echo "Nothing to deploy." - exit 0 -fi - if [[ ! -d build ]]; then echo "Build directory not found." exit 1 -- cgit v1.2.3-18-g5258 From fb15c8477e178abeb72e196f77da168e956768bf Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 6 Apr 2016 01:04:43 +0200 Subject: travis: trying to fix deploy --- build-aux/travis-deploy.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index 71469ff..0ef28bf 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -2,6 +2,21 @@ 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 [[ "x${CC}" != "xgcc" ]] || [[ "x${TARGET}" = "xvalgrind" ]]; then + echo "Invalid target for deploy. skipping ..." + exit 0 +fi + if [[ ! -d build ]]; then echo "Build directory not found." exit 1 -- cgit v1.2.3-18-g5258 From 4b62c5dbb57fabdf48f72e142442af6c6a3334b9 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 28 Apr 2016 03:08:34 +0200 Subject: build: drop windows support --- build-aux/travis-deploy.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'build-aux/travis-deploy.sh') diff --git a/build-aux/travis-deploy.sh b/build-aux/travis-deploy.sh index 0ef28bf..51aac3e 100755 --- a/build-aux/travis-deploy.sh +++ b/build-aux/travis-deploy.sh @@ -22,9 +22,7 @@ if [[ ! -d build ]]; then exit 1 fi -if [[ "x${TARGET}" = xw* ]]; then - FILES=( build/*.zip ) -elif [[ "x${TARGET}" = "xdist-srpm" ]]; then +if [[ "x${TARGET}" = "xdist-srpm" ]]; then FILES=( build/*.src.rpm ) else FILES=( build/*.{*.tar.{gz,bz2,xz},zip} ) -- cgit v1.2.3-18-g5258