From 029b31b3b1c01ae4f2314439cd8e0f7369b290ff Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 9 Apr 2015 00:00:23 +0100 Subject: [PATCH] Added build.sh --- .gitignore | 1 + build.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 build.sh diff --git a/.gitignore b/.gitignore index 01600603..08c28988 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/gh-pages-deployment/ /output_*/ /source/components/ /.sculpin/ diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..8afd385d --- /dev/null +++ b/build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -x + +SCULPIN='/usr/local/bin/sculpin' +ENV='prod' +REPO='git@github.com:opdavies/opdavies.github.io.git' +DEPLOY_DIR='./gh-pages-deployment' +BRANCH='master' + +rm -rf ./output_${ENV} +${SCULPIN} generate --env=${ENV} + +LOG=$(git log --oneline -n 1) + +rm -rf ${DEPLOY_DIR} +git clone ${REPO} ${DEPLOY_DIR} + +pushd ${DEPLOY_DIR} + +git checkout -B ${BRANCH} + +cp -R ../output_${ENV}/* ./ + +git add -A . +git commit -m "${LOG}" +git push origin ${BRANCH} --force + +popd \ No newline at end of file