CircleCI auto-deploy?

This commit is contained in:
Ariejan de Vroom 2016-07-21 10:45:41 +02:00
parent a608704546
commit fc06fcb7b3
Signed by untrusted user who does not match committer: ariejan
GPG Key ID: AD739154F713697B
3 changed files with 49 additions and 0 deletions

11
ci-install-hugo.sh Executable file
View File

@ -0,0 +1,11 @@
HUGO_VERSION=0.16
HUGO_DOWNLOAD=hugo_${HUGO_VERSION}_linux-64bit.tgz
set -x
set -e
# Install Hugo if not already cached or upgrade an old version.
if [ ! -e $CIRCLE_BUILD_DIR/bin/hugo ] || ! [[ `hugo version` =~ v${HUGO_VERSION} ]]; then
wget https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_DOWNLOAD}
tar xvzf ${HUGO_DOWNLOAD} -C $CIRCLE_BUILD_DIR/bin/
fi

7
ci-install-yuicompressor.sh Executable file
View File

@ -0,0 +1,7 @@
set -x
set -e
# Install yuicompressor if not already cached
if [ ! -e $CIRCLE_BUILD_DIR/bin/yuicompressor ]; then
npm install -g --prefix ${CIRCLE_BUILD_DIR} yuicomporessor
fi

31
circle.yml Executable file
View File

@ -0,0 +1,31 @@
machine:
environment:
CIRCLE_BUILD_DIR: $HOME/$CIRCLE_PROJECT_REPONAME
PATH: $PATH:$CIRCLE_BUILD_DIR/bin
post:
- mkdir -p $CIRCLE_BUILD_DIR/bin
general:
branches:
only:
- master
dependencies:
pre:
- bash ./ci-install-hugo.sh
- bash ./ci-install-yuicompressor.sh
cache_directories:
- bin
test:
override:
- hugo -v
- yuicompressor themes/outerspace/static/css/outerspace.css -o themes/outerspace/static/css/outerspace-min.css
deployment:
master:
branch: master
commands:
- rsync -aqz --delete-after --no-progress public/ -e ssh $RSYNC_TARGET