oliverdavies.uk/build.sh

29 lines
507 B
Bash
Raw Normal View History

2015-04-08 23:00:23 +00:00
#!/bin/bash
set -x
2015-04-09 16:07:32 +00:00
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}
2015-04-08 23:00:23 +00:00
LOG=$(git log --oneline -n 1)
2015-04-09 16:07:32 +00:00
rm -rf ${BUILD_DIR}
git clone ${REPO} ${BUILD_DIR}
2015-04-08 23:00:23 +00:00
2015-04-09 16:07:32 +00:00
pushd ${BUILD_DIR}
2015-04-08 23:00:23 +00:00
2015-04-09 16:07:32 +00:00
git checkout -B ${BRANCH}
2015-04-08 23:00:23 +00:00
2015-04-09 16:07:32 +00:00
rsync --quiet --archive --filter="P .git*" --delete ../output_${ENV}/ ./
2015-04-08 23:00:23 +00:00
git add -A .
git commit -m "${LOG}"
2015-04-09 16:07:32 +00:00
git push origin ${BRANCH} --force
2015-04-08 23:00:23 +00:00
popd