File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ #! /bin/bash
2+
3+ # Set the tmpdir
4+ if [ -z " $TMPDIR " ]; then
5+ TMPDIR=" /tmp"
6+ fi
7+
8+ # Create a temporary build dir and make sure we clean it up. For
9+ # debugging, comment out the trap line.
10+ DEPLOY=` mktemp -d $TMPDIR /terraform-www-XXXXXX`
11+ trap " rm -rf $DEPLOY " INT TERM EXIT
212
313# Get the parent directory of where this script is.
414SOURCE=" ${BASH_SOURCE[0]} "
515while [ -h " $SOURCE " ] ; do SOURCE=" $( readlink " $SOURCE " ) " ; done
616DIR=" $( cd -P " $( dirname " $SOURCE " ) /.." && pwd ) "
717
18+ # Copy into tmpdir
19+ cp -R $DIR /website/ $DEPLOY /
20+
821# Change into that directory
9- cd $DIR
22+ pushd $DEPLOY & > /dev/null
23+
24+ # Ignore some stuff
25+ touch .gitignore
26+ echo " .sass-cache" >> .gitignore
27+ echo " build" >> .gitignore
28+
29+ # Add everything
30+ git init -q .
31+ git add .
32+ git commit -q -m " Deploy by $USER "
33+
34+ git remote add heroku git@heroku.com:terraform-www.git
35+ git push -f heroku master
1036
11- # Push the subtree (force)
12- git push heroku ` git subtree split --prefix website HEAD ` :master --force
37+ # Go back to our root
38+ popd & > /dev/null
You can’t perform that action at this time.
0 commit comments