diff --git a/.travis.yml b/.travis.yml index d8c16abf3..c70ab4605 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,14 +45,9 @@ before_deploy: - ssh-add /tmp/deploy_rsa deploy: - provider: packagecloud - username: "${PACKAGECLOUD_USER}" - repository: "${PACKAGECLOUD_REPO}" - token: "${PACKAGECLOUD_TOKEN}" - dist: "${OS}/${DIST}" - package_glob: build/*.{deb,rpm} + provider: script skip_cleanup: true + script: utils/packpack/rsync_xfer.sh on: branch: master - condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}" diff --git a/utils/packpack/rsync_xfer.sh b/utils/packpack/rsync_xfer.sh new file mode 100755 index 000000000..f6e7926b7 --- /dev/null +++ b/utils/packpack/rsync_xfer.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Required, so that Travis marks the build as failed if any of the steps below fail +set -ev + +# Check to see if this script has access to all the commands it needs +for CMD in sshfs rsync find fusermount mkdir; do + type $CMD 2>&1 > /dev/null + + if [ $? -ne 0 ]; then + echo + echo "ERROR: The script cannot find the required command \"${CMD}\"." + echo + exit $? + fi +done + +mkdir -p ./zmrepo +ssh_mntchk="$(sshfs zmrepo@zmrepo.zoneminder.com:./ ./zmrepo -o workaround=rename,reconnect)" + +if [ -z "$ssh_mntchk" ]; then + # Don't keep packages older than 5 days + find ./zmrepo -maxdepth 1 -type f -mtime +5 -delete + rsync --ignore-errors ./build/ ./zmrepo/ + fusermount -zu zmrepo +else + echo + echo "ERROR: Attempt to mount zmrepo.zoneminder.com failed!" + echo "sshfs gave the following error message:" + echo \"$ssh_mntchk\" + echo +fi +