2018-11-10 22:51:01 +00:00
|
|
|
image: ruby:2.5.3
|
2018-11-10 22:26:23 +00:00
|
|
|
|
|
|
|
variables:
|
|
|
|
JEKYLL_ENV: production
|
|
|
|
LC_ALL: C.UTF-8
|
|
|
|
|
2018-11-29 17:35:40 +00:00
|
|
|
cache:
|
|
|
|
key: gems
|
|
|
|
paths:
|
2018-11-29 18:23:36 +00:00
|
|
|
- /usr/local/bundle/
|
2018-11-29 17:35:40 +00:00
|
|
|
|
2018-11-10 22:26:23 +00:00
|
|
|
before_script:
|
2018-11-18 16:05:08 +00:00
|
|
|
- 'which rsync || ( apt-get update -qq && apt-get install rsync -yqq )'
|
2018-11-18 16:07:00 +00:00
|
|
|
- eval $(ssh-agent -s)
|
2018-11-13 20:19:19 +00:00
|
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
|
|
|
- mkdir -p ~/.ssh
|
|
|
|
- chmod 700 ~/.ssh
|
|
|
|
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
|
|
|
- chmod 644 ~/.ssh/known_hosts
|
2018-11-10 22:26:23 +00:00
|
|
|
- bundle install
|
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- bundle exec jekyll build -d test
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- test
|
|
|
|
except:
|
|
|
|
- master
|
|
|
|
|
2018-11-29 16:07:23 +00:00
|
|
|
deploy:production:
|
2018-11-10 22:26:23 +00:00
|
|
|
stage: deploy
|
|
|
|
script:
|
|
|
|
- bundle exec jekyll build -d public
|
2018-11-18 16:05:08 +00:00
|
|
|
- rsync -aqz public/ cotech@webarch2.co.uk:sites/default/
|
2018-11-29 16:07:23 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
2018-11-29 17:00:24 +00:00
|
|
|
environment:
|
|
|
|
name: production
|
|
|
|
url: https://static.coops.tech
|
2018-11-29 16:07:23 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
|
|
|
|
|
|
|
deploy:dev:
|
|
|
|
stage: deploy
|
|
|
|
script:
|
2018-11-29 14:47:18 +00:00
|
|
|
- bundle exec jekyll build -d public
|
2018-11-29 12:49:27 +00:00
|
|
|
- rsync -aqz public/ cotech@webarch2.co.uk:sites/dev/
|
2018-11-10 22:26:23 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
2018-11-29 17:00:24 +00:00
|
|
|
environment:
|
|
|
|
name: dev
|
|
|
|
url: https://dev.static.coops.tech
|
2018-11-10 22:26:23 +00:00
|
|
|
only:
|
2018-11-29 16:07:23 +00:00
|
|
|
- dev
|