2017-12-14 07:03:59 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-12-14 07:38:12 +08:00
|
|
|
if [ "$TRAVIS" = "true" ]; then
|
2017-12-14 07:03:59 +08:00
|
|
|
|
2017-12-14 07:38:12 +08:00
|
|
|
if test "$TRAVIS_TAG"; then
|
|
|
|
PKG_NAME=$TRAVIS_TAG
|
|
|
|
else
|
|
|
|
PKG_NAME=nightly
|
|
|
|
fi
|
2017-12-14 07:25:14 +08:00
|
|
|
|
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:37:26 +08:00
|
|
|
|
|
|
|
# delete all superfluous files
|
|
|
|
echo "cleaning files"
|
2017-12-14 07:31:58 +08:00
|
|
|
find . -type d -name ".git" | xargs rm -rf
|
2017-12-15 01:37:26 +08:00
|
|
|
rm -rf .idea phpvms.iml .travis .dpl
|
|
|
|
rm -rf .phpstorm.meta.php _ide_helper.php
|
|
|
|
rm -rf .env .env.prod.example
|
|
|
|
mv .env.dev.example .env
|
|
|
|
|
|
|
|
echo "creating tarball"
|
|
|
|
tar -czf /tmp/$TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms/.
|
2017-12-14 07:25:14 +08:00
|
|
|
|
2017-12-15 01:02:29 +08:00
|
|
|
echo "running rsync"
|
2017-12-15 01:09:02 +08:00
|
|
|
rsync -ahP --delete-after /tmp/$TAR_NAME downloads@phpvms.net:/var/www/downloads/
|
2017-12-14 07:25:14 +08:00
|
|
|
fi
|