2018-05-29 21:49:40 +02:00
|
|
|
---
|
2018-08-02 20:47:24 +02:00
|
|
|
image: s3lph/matemat-ci:20180802-02
|
2018-05-29 21:49:40 +02:00
|
|
|
|
2018-06-05 22:38:42 +02:00
|
|
|
stages:
|
|
|
|
- test
|
2018-07-11 17:17:00 +02:00
|
|
|
- build
|
|
|
|
- staging
|
2018-06-05 22:38:42 +02:00
|
|
|
|
2018-05-29 21:49:40 +02:00
|
|
|
test:
|
2018-06-05 22:38:42 +02:00
|
|
|
stage: test
|
2018-05-29 21:49:40 +02:00
|
|
|
script:
|
|
|
|
- pip3 install -r requirements.txt
|
2018-08-18 02:44:09 +02:00
|
|
|
- sudo -u matemat python3 -m coverage run --rcfile=setup.cfg -m unittest discover matemat
|
|
|
|
- sudo -u matemat python3 -m coverage combine
|
|
|
|
- sudo -u matemat python3 -m coverage report --rcfile=setup.cfg
|
2018-06-05 22:32:09 +02:00
|
|
|
|
|
|
|
codestyle:
|
2018-07-11 17:17:00 +02:00
|
|
|
stage: test
|
2018-06-05 22:32:09 +02:00
|
|
|
script:
|
|
|
|
- pip3 install -r requirements.txt
|
2018-07-10 22:18:57 +02:00
|
|
|
- sudo -u matemat pycodestyle matemat
|
2018-07-10 20:25:34 +02:00
|
|
|
|
2018-07-11 17:17:00 +02:00
|
|
|
build:
|
|
|
|
stage: build
|
2018-07-10 20:25:34 +02:00
|
|
|
script:
|
2018-07-10 22:33:44 +02:00
|
|
|
- docker build -t "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" .
|
2018-08-02 22:08:47 +02:00
|
|
|
- docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:latest-$([[ $CI_COMMIT_REF_NAME == "master" ]] && echo stable || echo staging)"
|
2018-07-10 20:25:34 +02:00
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com
|
2018-08-02 22:08:47 +02:00
|
|
|
- docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA"
|
|
|
|
- docker push registry.gitlab.com/s3lph/matemat:latest-$([[ $CI_COMMIT_REF_NAME == "master" ]] && echo stable || echo staging)
|
2018-07-17 20:30:40 +02:00
|
|
|
only:
|
2018-08-02 17:21:22 +02:00
|
|
|
- staging
|
2018-08-02 21:55:22 +02:00
|
|
|
- master
|
2018-07-11 17:17:00 +02:00
|
|
|
|
|
|
|
staging:
|
|
|
|
stage: staging
|
|
|
|
script:
|
2018-07-11 17:34:59 +02:00
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- ssh-add - <<<"$STAGING_SSH_PRIVATE_KEY"
|
2018-08-02 22:08:47 +02:00
|
|
|
- echo "$CI_COMMIT_SHA" | ssh -p 20022 -oStrictHostKeyChecking=no matemat@kernelpanic.lol
|
2018-07-11 17:17:00 +02:00
|
|
|
environment:
|
2018-07-11 17:20:24 +02:00
|
|
|
name: staging
|
|
|
|
url: https://matemat.kernelpanic.lol/
|
2018-07-11 17:37:48 +02:00
|
|
|
only:
|
2018-08-02 17:21:22 +02:00
|
|
|
- staging
|