added scripts

This commit is contained in:
Steven Hugg 2018-07-26 08:50:20 -07:00
parent 5756f3b467
commit bc5fe5a5cf
10 changed files with 69 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
*~
node_modules
scripts
blog
local
release

View File

@ -1,2 +1,8 @@
# 8bitworkshop
8bitworkshop.com
git submodule init
git submodule update
npm i
npm run build

@ -1 +1 @@
Subproject commit 4334727f0e07acd4541b0a7b8f81a5984cd4aafe
Subproject commit ebf81921f80024e3e94c7a8e1235ab59464fa5ef

1
scripts/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
env.sh

5
scripts/sync-blog.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. ./scripts/env.sh
rsync --stats -arilv -e "ssh -p 2222" ./blog/ $RSYNC_PATH/blog/
#rsync --stats -arilv -e "ssh -p 2222" ./scripts/ pzp@104.131.86.119:./backups

7
scripts/sync-dev.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
. ./scripts/env.sh
DESTPATH=$RSYNC_PATH/dev/
git ls-files -z | rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules -aril -e "ssh -p 2222" --files-from - -0 . $DESTPATH
git archive --format tar.gz --prefix 8bitworkshop- HEAD tools/ > release/8bitworkshop-tools.tgz
rsync --stats -arilvz -e "ssh -p 2222" ./gen ./mame $DESTPATH/

10
scripts/sync-production.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
. ./scripts/env.sh
DESTPATH=$RSYNC_PATH/
echo "Upload HEAD to production? [Press Enter]"
read
git ls-files -z | rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules -aril -e "ssh -p 2222" --files-from - -0 . $DESTPATH
git archive --format tar.gz --prefix 8bitworkshop- HEAD tools/ > release/8bitworkshop-tools.tgz
#rsync --stats -arilvz -e "ssh -p 2222" ./mame $DESTPATH/
echo "Done."

6
scripts/sync-staging.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
DESTPATH=$RSYNC_PATH/staging/
git ls-files -z | rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules -aril -e "ssh -p 2222" --files-from - -0 . $DESTPATH
git archive --format tar.gz --prefix 8bitworkshop- HEAD tools/ > release/8bitworkshop-tools.tgz
rsync --stats -arilvz -e "ssh -p 2222" ./mame $DESTPATH/

5
scripts/sync-tools.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. ./scripts/env.sh
DESTPATH=$RSYNC_PATH/
rsync --stats -arilv -e "ssh -p 2222" ./release/ $DESTPATH/release

28
scripts/sync-version-prod.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/sh
. ./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
DEVPATH=/var/www/8bitworkshop.com/dev
TMPDIR=/tmp/8bitws/$VERSION
grep "var VERSION" redir.html
echo "Upload version $VERSION to production? (edited redir.html?)"
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..."
rsync --stats --exclude '.*' --exclude 'scripts/*' --exclude=node_modules --copy-dest=$DEVPATH -aril -e "ssh -p 2222" $TMPDIR/ $SUBMODS $DESTPATH
rsync -a -e "ssh -p 2222" redir.html $DESTPATH/../index.html
#git ls-files -z |
git archive --format tar.gz --prefix 8bitworkshop- HEAD tools/ > release/8bitworkshop-tools.tgz
#rsync --stats -arilvz -e "ssh -p 2222" ./mame $DESTPATH/
echo "Done."