.gitlab-ci.yml 1023 Bytes
Newer Older
okhin's avatar
okhin committed
1
2
3
4
5
variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"

cache:
    paths:
6
7
8
        - "pip-cache"
        - "static"
        - "env"
okhin's avatar
okhin committed
9
10
11
12
13
14
15
16
17
18
    key: "$CI_PROJECT_ID"

stages:
    - test
    - build
    - deploy

unit tests:
    stage: test
    script:
okhin's avatar
okhin committed
19
        - virtualenv -p python3 env
okhin's avatar
okhin committed
20
21
22
23
24
25
        - source ./env/bin/activate
        - pip install -r requirements.txt
        - pip install -r requirements-dev.txt
        - pip install -r requirements-tests.txt
        - echo "DEBUG = True" > ./project/settings/env.py
        - echo "SECRET_KEY = '$(pwgen 20 1)'" >> ./project/settings/env.py
26
        - ./manage.py migrate
okhin's avatar
okhin committed
27
28
        - pytest apps/ --cov=apps/
    tags: [preprod]
29
30
31
32
33
34
35
36
37
38
39
40

static build:
    stage: test
    script:
        - yarn install
        - webpack
        - source ./env/bin/activate
        - pip install -r requirements.txt
        - echo "DEBUG = True" > ./project/settings/env.py
        - echo "SECRET_KEY = '$(pwgen 20 1)'" >> ./project/settings/env.py
        - ./manage.py collectstatic
    tags: [preprod]