.gitlab-ci.yml 1.17 KB
Newer Older
1
job test python:
okhin's avatar
okhin committed
2 3 4 5 6
    environment:
        preprod
    script:
        - virtualenv --python=python3 env
        - source env/bin/activate
7
        - pip install django
okhin's avatar
okhin committed
8
        - pip install coverage
9 10
        - python setup.py develop
        - cp picampaign/settings.py.sample picampaign/settings.py
okhin's avatar
okhin committed
11
        - ${VIRTUAL_ENV}/bin/coverage run --source='.' manage.py test
12
        - ${VIRTUAL_ENV}/bin/coverage report --omit="${VIRTUAL_ENV}/*",'*__init__.py'
okhin's avatar
okhin committed
13 14 15 16
    stage: test
    tags: [preprod]
    only:
        - master
17 18 19 20 21 22 23 24 25 26 27

job deploy:
    environment:
        preprod
    variables:
        GIT_DIR: '/srv/piphone/campaign/.git'
        GIT_WORK_DIR: '/srv/piphone/campaign/'
    script:
        - git pull origin master
        - source /srv/piphone/campaign/env/bin/activate
        - pip install --upgrade pip
28
        - pip install django
29 30
        - python /srv/piphone/campaign/setup.py install
        - python /srv/piphone/campaign/manage.py migrate
okhin's avatar
okhin committed
31
        - python /srv/piphone/campaign/manage.py collectstatic --noinput
32 33
        - python /srv/piphone/campaign/manage.py compilemessages
        - touch /srv/piphone/campaign.ready
34
    stage: deploy
35 36 37
    tags: [preprod]
    only:
        - master