2015-04-08 23:00:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
SCULPIN='/usr/local/bin/sculpin'
|
|
|
|
ENV='prod'
|
|
|
|
BRANCH='master'
|
2015-04-08 23:14:08 +00:00
|
|
|
REPO="git@github.com:opdavies/opdavies.github.io.git --branch ${BRANCH}"
|
|
|
|
DEPLOY_DIR='./gh-pages-deployment'
|
2015-04-08 23:00:23 +00:00
|
|
|
|
|
|
|
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}
|
|
|
|
|
2015-04-08 23:14:08 +00:00
|
|
|
rsync --quiet --archive --delete ../output_${ENV}/ ./
|
2015-04-08 23:00:23 +00:00
|
|
|
|
|
|
|
git add -A .
|
|
|
|
git commit -m "${LOG}"
|
|
|
|
git push origin ${BRANCH} --force
|
|
|
|
|
|
|
|
popd
|