blob: 5389495a2cecf5f5fa249dc92ecb9ecefb71a4b6 (
plain) (
blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
stages:
- build
- lint
- test
- deploy
cache:
paths:
- .cache/
variables:
PIPENV_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
build base image:
image: docker:stable-git
stage: build
script:
- sh scripts/deploy-ci.sh
tags:
- docker
only:
- master
- django
lint:
image: registry.gitlab.com/python-discord/projects/site/django-base:latest
stage: lint
script:
- pipenv install --dev
- flake8
test:
image: registry.gitlab.com/python-discord/projects/site/django-base:latest
stage: test
services:
- postgres:10-alpine
before_script:
- python manage.py migrate
- pip install coverage
script:
- coverage run --source=api,home,pysite,wiki --branch manage.py test
after_script:
- coverage report
artifacts:
paths:
- .coverage
variables:
DATABASE_URL: postgres://django:supersecret@postgres/pysite
POSTGRES_DB: pysite
POSTGRES_PASSWORD: supersecret
POSTGRES_USER: django
pages:
stage: deploy
image:
dependencies:
- test
before_script:
- pip install coverage
script:
- coverage html --directory=public
artifacts:
paths:
- public
expire_in: 30 days
|