2022-11-06 19:32:22 +00:00
|
|
|
---
|
2020-10-11 13:47:35 +00:00
|
|
|
image: ruby:2.6.6
|
2018-11-10 22:26:23 +00:00
|
|
|
|
2018-11-30 16:48:08 +00:00
|
|
|
stages:
|
2022-11-06 19:32:22 +00:00
|
|
|
- test
|
|
|
|
- staging
|
|
|
|
- production
|
2018-11-30 16:48:08 +00:00
|
|
|
|
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-30 17:25:23 +00:00
|
|
|
- vendor
|
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
|
2022-11-06 19:28:17 +00:00
|
|
|
- ssh-keyscan web.cotech.uk > ~/.ssh/known_hosts
|
2022-11-06 19:51:01 +00:00
|
|
|
- ssh-keyscan 81.95.52.59 >> ~/.ssh/known_hosts
|
2018-11-13 20:19:19 +00:00
|
|
|
- chmod 644 ~/.ssh/known_hosts
|
2018-11-30 17:25:23 +00:00
|
|
|
- bundle install --path vendor
|
2018-11-10 22:26:23 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
script:
|
2022-11-06 19:32:22 +00:00
|
|
|
- bundle exec jekyll build -d test
|
2018-11-10 22:26:23 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-11-06 19:32:22 +00:00
|
|
|
- test
|
2018-11-10 22:26:23 +00:00
|
|
|
except:
|
2022-11-06 19:32:22 +00:00
|
|
|
- master
|
2018-11-10 22:26:23 +00:00
|
|
|
|
2018-11-30 16:12:38 +00:00
|
|
|
deploy:dev:
|
2018-11-30 16:48:08 +00:00
|
|
|
stage: staging
|
2018-11-10 22:26:23 +00:00
|
|
|
script:
|
2022-11-06 19:32:22 +00:00
|
|
|
- bundle exec jekyll build -d public
|
|
|
|
- rsync -aqz --delete-after public/ cotech@web.cotech.uk:sites/dev/
|
2018-11-29 16:07:23 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-11-06 19:32:22 +00:00
|
|
|
- public
|
2018-11-29 17:00:24 +00:00
|
|
|
environment:
|
2018-11-30 16:12:38 +00:00
|
|
|
name: dev
|
2018-11-30 18:01:32 +00:00
|
|
|
url: https://dev.coops.tech
|
2018-11-29 16:07:23 +00:00
|
|
|
only:
|
2022-11-06 19:32:22 +00:00
|
|
|
- master
|
2018-11-29 16:07:23 +00:00
|
|
|
|
2018-11-30 16:12:38 +00:00
|
|
|
deploy:production:
|
2018-11-30 16:48:08 +00:00
|
|
|
stage: production
|
2018-11-29 16:07:23 +00:00
|
|
|
script:
|
2022-11-06 19:32:22 +00:00
|
|
|
- bundle exec jekyll build -d public
|
|
|
|
- rsync -aqz --delete-after public/ cotech@web.cotech.uk:sites/default/
|
2018-11-10 22:26:23 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-11-06 19:32:22 +00:00
|
|
|
- public
|
2018-11-29 17:00:24 +00:00
|
|
|
environment:
|
2018-11-30 16:12:38 +00:00
|
|
|
name: production
|
2018-11-30 18:01:32 +00:00
|
|
|
url: https://www.coops.tech
|
2018-11-10 22:26:23 +00:00
|
|
|
only:
|
2022-11-06 19:32:22 +00:00
|
|
|
- master
|
2019-02-15 12:44:48 +00:00
|
|
|
when: manual
|
|
|
|
|
|
|
|
after_script:
|
2022-11-06 19:32:22 +00:00
|
|
|
- rm -rf /root/.ssh/
|
|
|
|
...
|