2018-08-06 21:29:59 +00:00
|
|
|
#!/bin/bash
|
2018-07-26 15:50:20 +00:00
|
|
|
|
|
|
|
. ./scripts/env.sh
|
|
|
|
VERSION=`git tag | tail -1`
|
|
|
|
#VERSION=`git tag -l HEAD`
|
|
|
|
if [ "$VERSION" == "" ]; then
|
|
|
|
echo "No version at HEAD! Tag it first!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
DESTPATH=$RSYNC_PATH/v$VERSION
|
2019-08-08 18:31:20 +00:00
|
|
|
DEVPATH=/var/www/html/8bitworkshop.com/dev
|
2018-08-06 21:29:59 +00:00
|
|
|
TMPDIR=./tmp/$VERSION
|
2019-08-22 17:40:53 +00:00
|
|
|
grep -H "var VERSION" web/redir.html
|
|
|
|
grep -H "var VERSION" web/projects/projects.js
|
|
|
|
echo "Upload version $VERSION to production?"
|
2018-07-26 15:50:20 +00:00
|
|
|
read
|
|
|
|
echo "Listing submodules..."
|
|
|
|
SUBMODS=`git submodule | cut -d ' ' -f 3`
|
|
|
|
echo "Extracting to $TMPDIR..."
|
|
|
|
rm -fr $TMPDIR
|
|
|
|
mkdir -p $TMPDIR
|
|
|
|
git archive $VERSION | tar x -C $TMPDIR
|
|
|
|
echo "Copying to $DESTPATH..."
|
2019-05-18 19:26:51 +00:00
|
|
|
rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules --copy-dest=$DEVPATH -rilz --chmod=a+rx -e "ssh" $TMPDIR/ $SUBMODS $DESTPATH
|
|
|
|
rsync --stats -rpilvz --chmod=a+rx -e "ssh" --copy-dest=$DEVPATH ./gen config.js $DESTPATH/
|
2018-07-26 15:50:20 +00:00
|
|
|
echo "Done."
|