phpvms/.travis/deploy_script.sh

32 lines
856 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
2017-12-15 22:13:42 +08:00
PKG_NAME=master
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:37:26 +08:00
# delete all superfluous files
echo "cleaning files"
cd $TRAVIS_BUILD_DIR
2017-12-16 08:02:35 +08:00
find ./vendor -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
2017-12-17 10:49:13 +08:00
rm -rf node_modules
2017-12-16 23:27:19 +08:00
php artisan version:show --format compact --suppress-app-name > VERSION
2017-12-15 01:37:26 +08:00
echo "creating tarball"
2017-12-18 02:18:11 +08:00
cd /tmp
tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../ phpvms phpvms/.*
#git archive --format=tar.gz --prefix=phpvms/ --output=test.tar.gz HEAD
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/
fi