zoneminder/utils/packpack/rsync_xfer.sh

50 lines
1.4 KiB
Bash
Raw Normal View History

2017-02-27 15:45:08 +00:00
#!/bin/bash
# We don't deploy during eslint checks, so exit immediately
if [ "${DIST}" == "eslint" ]; then
exit 0
fi
2017-02-27 15:45:08 +00:00
# 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
2017-02-28 13:28:07 +00:00
exit 1
2017-02-27 15:45:08 +00:00
fi
done
2017-03-04 16:16:05 +00:00
# See https://docs.travis-ci.com/user/cron-jobs/
#
# TO-DO: Deploy after ever commit for rpm builds after pacakge signing & repo creation is containerized
#
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ] || [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ]; then
2017-02-27 15:45:08 +00:00
if [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ]; then
2017-05-02 18:44:34 +00:00
targetfolder="debian/master/mini-dinstall/incoming"
else
targetfolder="travis"
fi
echo
echo "Target subfolder set to $targetfolder"
echo
2019-12-25 15:05:50 +00:00
echo "Running \$(rsync -v -e 'ssh -vvv' build/*.{rpm,deb,dsc,tar.xz,changes} zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)"
rsync -v --ignore-missing-args -e 'ssh -vvv' build/*.{rpm,deb,dsc,tar.xz,changes} zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1
if [ "$?" -eq 0 ]; then
echo
echo "Files copied successfully."
echo
else
2017-03-04 16:16:05 +00:00
echo
2019-10-09 17:00:29 +00:00
echo "ERROR: Attempt to rsync to zmrepo.zoneminder.com failed!"
echo "See log output for details."
2017-03-04 16:16:05 +00:00
echo
exit 99
2017-03-04 16:16:05 +00:00
fi
fi