Use a faster middleman deploy
This commit is contained in:
parent
25bba59676
commit
3e7e3232a6
|
@ -1,12 +1,38 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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/terraform-www-XXXXXX`
|
||||||
|
trap "rm -rf $DEPLOY" INT TERM EXIT
|
||||||
|
|
||||||
# Get the parent directory of where this script is.
|
# Get the parent directory of where this script is.
|
||||||
SOURCE="${BASH_SOURCE[0]}"
|
SOURCE="${BASH_SOURCE[0]}"
|
||||||
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
|
||||||
|
|
||||||
# Change into that directory
|
# Copy into tmpdir
|
||||||
cd $DIR
|
cp -R $DIR/website/ $DEPLOY/
|
||||||
|
|
||||||
# Push the subtree (force)
|
# Change into that directory
|
||||||
git push heroku `git subtree split --prefix website HEAD`:master --force
|
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:terraform-www.git
|
||||||
|
git push -f heroku master
|
||||||
|
|
||||||
|
# Go back to our root
|
||||||
|
popd &>/dev/null
|
||||||
|
|
Loading…
Reference in New Issue