phpvms/.travis/deploy_script.sh

23 lines
582 B
Bash
Raw Normal View History

2017-12-14 07:03:59 +08:00
#!/usr/bin/env bash
if [ "$TRAVIS" = "true" ]; then
2017-12-14 07:03:59 +08:00
if test "$TRAVIS_TAG"; then
PKG_NAME=$TRAVIS_TAG
else
PKG_NAME=nightly
fi
2017-12-15 01:02:29 +08:00
TAR_NAME="phpvms-7.0.0-$PKG_NAME.tar.gz"
echo "Writing $TAR_NAME"
2017-12-14 07:31:58 +08:00
2017-12-15 01:02:29 +08:00
echo "creating tarball"
# delete all superfluous files and tar it up
rm -rf .git deploy_rsa.enc .idea phpvms.iml .travis .dpl
2017-12-14 07:31:58 +08:00
find . -type d -name ".git" | xargs rm -rf
2017-12-15 01:02:29 +08:00
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms
2017-12-15 01:02:29 +08:00
echo "running rsync"
rsync -ahP --delete-after $TAR_NAME downloads@phpvms.net:/var/www/downloads/
fi