.gitlab-ci.yml 1.03 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 17

stages:
    - test
    - deploy

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

unit:
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 23 24 25 26 27 28 29 30 31 32

qa:
    stage: test
    script: tox -e qa
    tags: [memopol]

docs:
    stage: test
    script: tox -e docs
    tags: [memopol]

deploy:
Jamesie Pic's avatar
Jamesie Pic committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
    script:
        - source /srv/memopol/memopol_env/bin/activate
        - cd /srv/memopol/memopol_env/src/memopol/docs
        - make html
        - cd /srv/memopol/memopol_env/src/memopol
        - git fetch origin
        - git reset --hard origin/master
        - find . -name '*.pyc' -delete
        - pip install -Ue .
        - src/memopol/bin/install_client_deps.sh
        - memopol migrate --noinput
        - memopol collectstatic --noinput
        - touch /srv/memopol/ready
    stage: deploy
    tags: [memopol]
    environment: production
    only:
        - master