Updated ci script

This commit is contained in:
Ariejan de Vroom 2017-09-04 15:39:20 +02:00
parent 5e4da46250
commit 5f8e0612d4
Signed by: ariejan
GPG Key ID: AD739154F713697B

View File

@ -1,28 +1,29 @@
image: ariejan/dockerized-hugo
image: ariejan/dockerized-hugo:0.26
stages:
- build
- deploy
build:
stage: build
test:
script:
- hugo
except:
- master
pages:
before_script:
# Setup SSH keys
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
# Compile
- hugo
# Compress CSS
- yui-compressor public/css/outerspace.css -o public/css/outerspace-min.css
- mv -f public/css/outerspace-min.css public/css/outerspace.css
artifacts:
paths:
- public
deploy_prod:
stage: deploy
script:
#- s3cmd sync --acl-public --reduced-redundancy --delete-removed --cf-invalidate public/* s3://$AWS_BUCKET
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- ls -lah ~/.ssh/id_rsa*
- chmod 700 ~/.ssh
- chmod 600 ~/.ssh/id_rsa
# Deploy
- rsync -az4 --stats --delete-after public/* -e "ssh -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" ariejan@mail.devroom.io:/home/ariejan/www/devroom.io/
artifacts:
paths: