From 62611d95414ebb272b81bc565daa0c7646a3727c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 9 Apr 2015 17:07:32 +0100 Subject: [PATCH] Use more variables --- build.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 1cb5ab5a4..912550659 100755 --- a/build.sh +++ b/build.sh @@ -2,22 +2,28 @@ set -x -rm -rf ./output_prod -/usr/local/bin/sculpin generate --env=prod +SCULPIN='/usr/local/bin/sculpin' +ENV='prod' +REPO='git@github.com:opdavies/opdavies.github.io.git' +BRANCH='master' +BUILD_DIR='./gh-pages-deployment/' + +rm -rf ./output_${ENV} +${SCULPIN} generate --env=${ENV} LOG=$(git log --oneline -n 1) -rm -rf ./gh-pages-deployment/ -git clone git@github.com:opdavies/opdavies.github.io.git ./gh-pages-deployment/ +rm -rf ${BUILD_DIR} +git clone ${REPO} ${BUILD_DIR} -pushd ./gh-pages-deployment/ +pushd ${BUILD_DIR} -git checkout -B master +git checkout -B ${BRANCH} -rsync --quiet --archive --filter="P .git*" --delete ../output_prod/ ./ +rsync --quiet --archive --filter="P .git*" --delete ../output_${ENV}/ ./ git add -A . git commit -m "${LOG}" -git push origin master --force +git push origin ${BRANCH} --force popd \ No newline at end of file