2017-02-27 23:45:08 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-12-25 22:41:53 +08:00
|
|
|
# We don't deploy during eslint checks, so exit immediately
|
|
|
|
if [ "${DIST}" == "eslint" ]; then
|
2019-12-27 23:04:02 +08:00
|
|
|
exit 0
|
2019-12-25 22:41:53 +08:00
|
|
|
fi
|
|
|
|
|
2017-02-27 23:45:08 +08: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 21:28:07 +08:00
|
|
|
exit 1
|
2017-02-27 23:45:08 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2019-12-27 23:04:02 +08:00
|
|
|
if [ "${OS}" == "debian" ] || [ "${OS}" == "ubuntu" ] || [ "${OS}" == "raspbian" ]; then
|
2020-02-07 03:46:26 +08:00
|
|
|
if [ "${RELEASE}" != "" ]; then
|
|
|
|
IFS='.' read -r -a VERSION_PARTS <<< "$RELEASE"
|
|
|
|
if [ "${VERSION_PARTS[0]}.${VERSION_PARTS[1]}" == "1.30" ]; then
|
|
|
|
targetfolder="debian/release/mini-dinstall/incoming"
|
|
|
|
else
|
|
|
|
targetfolder="debian/release-${VERSION_PARTS[0]}.${VERSION_PARTS[1]}/mini-dinstall/incoming"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
targetfolder="debian/master/mini-dinstall/incoming"
|
|
|
|
fi
|
2019-12-27 23:04:02 +08:00
|
|
|
else
|
|
|
|
targetfolder="travis"
|
|
|
|
fi
|
2017-04-22 07:57:10 +08:00
|
|
|
|
2019-12-27 23:04:02 +08:00
|
|
|
echo
|
|
|
|
echo "Target subfolder set to $targetfolder"
|
|
|
|
echo
|
2019-12-24 07:08:57 +08:00
|
|
|
|
2020-01-08 01:24:39 +08:00
|
|
|
echo "Running \$(rsync -v -e 'ssh -vvv' build/*.{rpm,deb,dsc,tar.xz,buildinfo,changes} zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1)"
|
2020-01-22 06:21:43 +08:00
|
|
|
rsync -v --ignore-missing-args --exclude 'external-repo.noarch.rpm' -e 'ssh -vvv' build/*.{rpm,deb,dsc,tar.xz,buildinfo,changes} zmrepo@zmrepo.zoneminder.com:${targetfolder}/ 2>&1
|
2019-12-27 23:04:02 +08:00
|
|
|
if [ "$?" -eq 0 ]; then
|
|
|
|
echo
|
|
|
|
echo "Files copied successfully."
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
echo
|
|
|
|
echo "ERROR: Attempt to rsync to zmrepo.zoneminder.com failed!"
|
|
|
|
echo "See log output for details."
|
|
|
|
echo
|
|
|
|
exit 99
|
2017-03-05 00:16:05 +08:00
|
|
|
fi
|