.gitlab-ci.yml 695 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1 2
image: python:3.6.5-jessie

Florent Chehab's avatar
Florent Chehab committed
3 4 5
services:
  - postgres:9.6.8

Florent Chehab's avatar
Florent Chehab committed
6 7 8
testing:
  stage: test
  script:
Florent Chehab's avatar
Florent Chehab committed
9
    - export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app
Florent Chehab's avatar
Florent Chehab committed
10 11 12 13 14 15 16 17 18 19 20 21
    - pip install -r requirements.txt
    - ./manage.py check
    - coverage3 run manage.py test              
    - coverage3 report
    - coverage3 html
  artifacts:
    paths:
      - htmlcov/
    expire_in: 1 month
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
22 23 24
flake8:
  stage: test
  script:
Florent Chehab's avatar
clean  
Florent Chehab committed
25
    - pip install flake8
Florent Chehab's avatar
Florent Chehab committed
26 27 28 29
    - flake8
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43
pages:
  stage: deploy
  dependencies:
    - testing
  script:
    - mv htmlcov/ public/
  artifacts:
    paths:
      - public
    expire_in: 1 month
  only: 
    - master
  tags:
    - docker