Add script to revert

This commit is contained in:
Jordan Eldredge 2016-11-28 23:15:31 -08:00
parent fcb90bab8b
commit c3e37158cf
3 changed files with 23 additions and 1 deletions

View file

@ -24,6 +24,13 @@ echo "Build the webpack bundle"
echo "Cleaning up node_modules/ to save space"
( cd $NEW_CLONE && rm -r node_modules)
PREVIOUS=$(readlink -f public_html/projects/winamp2-js)
echo "The previous buid was: $PREVIOUS"
echo "Creating 'previous' link to enable reverts"
ln -snf repos/previous
echo "Linking new Winamp2-js into place"
ln -snf `pwd`/$NEW_CLONE/ public_html/projects/winamp2-js

View file

@ -10,7 +10,8 @@
"weight": "npm run build && gzip-size built/winamp.js | pretty-bytes",
"test": "jest && npm run lint",
"tdd": "jest --watch",
"deploy": "ssh jordaneldredge.com sh < deploy.sh"
"deploy": "ssh jordaneldredge.com sh < deploy.sh",
"revert": "ssh jordaneldredge.com sh < revert.sh"
},
"repository": {
"type": "git",

14
revert.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Bail on errors
set -e
echo "Reverting..."
cd /var/www/jordaneldredge.com/
PREVIOUS=$(readlink -f repos/previous)
echo "Rolling back to $PREVIOUS"
ln -snf $PREVIOUS public_html/projects/winamp2-js
echo "Done!"