.gitlab-ci.yml 1.29 KB
Newer Older
1
variables:
Jamesie Pic's avatar
Jamesie Pic committed
2
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
3

okhin's avatar
okhin committed
4
cache:
Jamesie Pic's avatar
Jamesie Pic committed
5
6
7
    paths:
        - "$CI_PROJECT_DIR/pip-cache"
    key: "$CI_PROJECT_ID"
Jamesie Pic's avatar
Jamesie Pic committed
8
9
10
11
12
13
14
15
16

stages:
    - test
    - deploy

before_script:
    - pip install --user tox
    - export PATH="$HOME/.local/bin:$PATH"

17
unit tests:
Jamesie Pic's avatar
Jamesie Pic committed
18
    stage: test
Jamesie Pic's avatar
Jamesie Pic committed
19
    script: tox -e py27
Jamesie Pic's avatar
Jamesie Pic committed
20
    tags: [memopol]
Jamesie Pic's avatar
Jamesie Pic committed
21

22
qa checks:
Jamesie Pic's avatar
Jamesie Pic committed
23
24
25
26
    stage: test
    script: tox -e qa
    tags: [memopol]

27
docs build:
Jamesie Pic's avatar
Jamesie Pic committed
28
    stage: test
29
    script: git diff --raw HEAD^1 | grep docs || tox -e docs
Jamesie Pic's avatar
Jamesie Pic committed
30
31
    tags: [memopol]

32
33
docs deploy:
    stage: deploy
Jamesie Pic's avatar
Jamesie Pic committed
34
35
36
37
    script:
        - source /srv/memopol/memopol_env/bin/activate
        - cd /srv/memopol/memopol_env/src/memopol/docs
        - make html
38
39
40
41
42
43
44
45
46
    tags: [memopol]
    environment: production
    only:
        - master

django deploy:
    stage: deploy
    script:
        - source /srv/memopol/memopol_env/bin/activate
Jamesie Pic's avatar
Jamesie Pic committed
47
48
49
50
        - cd /srv/memopol/memopol_env/src/memopol
        - git fetch origin
        - git reset --hard origin/master
        - find . -name '*.pyc' -delete
51
        - rm -r src/*.egg-info
Jamesie Pic's avatar
Jamesie Pic committed
52
53
54
55
56
57
58
59
60
        - pip install -Ue .
        - src/memopol/bin/install_client_deps.sh
        - memopol migrate --noinput
        - memopol collectstatic --noinput
        - touch /srv/memopol/ready
    tags: [memopol]
    environment: production
    only:
        - master