2013-09-03 20:49:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-08-25 18:19:43 +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 /tmp/vagrant-www-XXXXXX`
|
|
|
|
trap "rm -rf $DEPLOY" INT TERM EXIT
|
|
|
|
|
2013-09-03 20:49:27 +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-08-25 18:19:43 +00:00
|
|
|
# Copy into tmpdir
|
2015-10-08 17:52:21 +00:00
|
|
|
shopt -s dotglob
|
|
|
|
cp -R $DIR/website/www/* $DEPLOY/
|
2015-08-25 18:19:43 +00:00
|
|
|
|
2013-09-03 20:49:27 +00:00
|
|
|
# Change into that directory
|
2015-08-25 18:19:43 +00:00
|
|
|
cd $DEPLOY
|
|
|
|
|
|
|
|
# Ignore some stuff
|
|
|
|
touch .gitignore
|
|
|
|
echo ".sass-cache" >> .gitignore
|
|
|
|
echo "build" >> .gitignore
|
2015-10-08 17:52:21 +00:00
|
|
|
echo "vendor" >> .gitignore
|
2015-08-25 18:19:43 +00:00
|
|
|
|
|
|
|
# Add everything
|
|
|
|
git init .
|
|
|
|
git add .
|
|
|
|
git commit -q -m "Deploy by $USER"
|
2013-09-03 20:49:27 +00:00
|
|
|
|
2015-08-25 18:19:43 +00:00
|
|
|
git remote add heroku git@heroku.com:vagrantup-www-2.git
|
|
|
|
git push -f heroku master
|
2014-12-12 08:53:50 +00:00
|
|
|
|
2015-08-25 18:19:43 +00:00
|
|
|
# Cleanup the deploy
|
|
|
|
rm -rf $DEPLOY
|