-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
50 lines (45 loc) · 1.18 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
variables:
DOCKER_DRIVER: overlay2
services:
- docker:stable-dind
stages:
- build
- test
- release
build-docker:
image: docker:stable
stage: build
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME || true
- docker build --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
- if [ ! -z $CI_COMMIT_TAG ]; then docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG && docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG; fi
- docker push $CI_REGISTRY_IMAGE:latest
only:
- dev
- stable
test:
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
before_script:
- pip install coverage
script:
- python manage.py test
pages:
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
stage: release
before_script:
- pip install -r docs/requirements.txt
script:
- cd docs
- make html
- mv build/html ../public
artifacts:
paths:
- public
only:
refs:
- stable
- dev
changes:
- docs/*