2015-09-20 18:09:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-09-21 20:20:36 +00:00
|
|
|
# Switch to the stable-website branch
|
|
|
|
git checkout stable-website
|
|
|
|
|
2015-09-20 18:09:35 +00:00
|
|
|
# Set the tmpdir
|
|
|
|
if [ -z "$TMPDIR" ]; then
|
|
|
|
TMPDIR="/tmp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Create a temporary build dir and make sure we clean it up. For
|
|
|
|
# debugging, comment out the trap line.
|
|
|
|
DEPLOY=`mktemp -d $TMPDIR/vault-www-XXXXXX`
|
|
|
|
trap "rm -rf $DEPLOY" INT TERM EXIT
|
2015-04-10 00:19:42 +00:00
|
|
|
|
|
|
|
# Get the parent directory of where this script is.
|
|
|
|
SOURCE="${BASH_SOURCE[0]}"
|
|
|
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
|
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
|
|
|
|
2015-09-20 18:09:35 +00:00
|
|
|
# Copy into tmpdir
|
2015-10-08 15:44:21 +00:00
|
|
|
cp -R $DIR/website/* $DEPLOY/
|
2015-09-20 18:09:35 +00:00
|
|
|
|
2015-04-10 00:19:42 +00:00
|
|
|
# Change into that directory
|
2015-09-20 18:09:35 +00:00
|
|
|
pushd $DEPLOY &>/dev/null
|
|
|
|
|
|
|
|
# Ignore some stuff
|
|
|
|
touch .gitignore
|
|
|
|
echo ".sass-cache" >> .gitignore
|
|
|
|
echo "build" >> .gitignore
|
|
|
|
|
|
|
|
# Add everything
|
|
|
|
git init -q .
|
|
|
|
git add .
|
|
|
|
git commit -q -m "Deploy by $USER"
|
|
|
|
|
|
|
|
git remote add heroku git@heroku.com:vault-www.git
|
|
|
|
git push -f heroku master
|
2015-04-10 00:19:42 +00:00
|
|
|
|
2015-09-20 18:09:35 +00:00
|
|
|
# Go back to our root
|
|
|
|
popd &>/dev/null
|