.gitlab-ci.yml 1.13 KB
Newer Older
1 2 3 4 5 6
stages:
  - test
  - syntaxe
  - doc
  - deploy

Florent Chehab's avatar
Florent Chehab committed
7 8
testing:
  stage: test
Florent Chehab's avatar
Florent Chehab committed
9 10 11
  image: python:3.6.5-jessie
  services:
    - postgres:9.6.8
Florent Chehab's avatar
Florent Chehab committed
12
  script:
Florent Chehab's avatar
Florent Chehab committed
13
    - export ENV=development
Florent Chehab's avatar
Florent Chehab committed
14
    - export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app
Florent Chehab's avatar
Florent Chehab committed
15
    - pip install -r requirements.txt --quiet
Florent Chehab's avatar
Florent Chehab committed
16 17 18 19 20 21 22 23 24 25 26
    - ./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
27
flake8:
28
  stage: syntaxe
Florent Chehab's avatar
Florent Chehab committed
29
  image: python:3.6.5-jessie
Florent Chehab's avatar
Florent Chehab committed
30
  script:
Florent Chehab's avatar
clean  
Florent Chehab committed
31
    - pip install flake8
Florent Chehab's avatar
Florent Chehab committed
32 33 34 35
    - flake8
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
36
pages:
37 38
  stage: doc
  image: floawfloaw/plantuml
Florent Chehab's avatar
Florent Chehab committed
39 40 41
  dependencies:
    - testing
  script:
42 43
    - mkdir .public
    - mv htmlcov/ .public/coverage
44 45 46
    - cd docs/UML
    - make all
    - cd ../../
47 48
    - mv docs/ .public/docs
    - mv .public public
Florent Chehab's avatar
Florent Chehab committed
49 50 51 52
  artifacts:
    paths:
      - public
    expire_in: 1 month
Florent Chehab's avatar
Florent Chehab committed
53 54
  only: 
    - master
Florent Chehab's avatar
Florent Chehab committed
55 56
  tags:
    - docker
Florent Chehab's avatar
Florent Chehab committed
57 58 59 60 61 62 63 64

preprod:
  type: deploy
  image: ruby
  script:
  - gem install dpl
  - dpl --provider=heroku --app=outgoing-preprod --api-key=$HEROKU_API_KEY
  only:
Florent Chehab's avatar
Florent Chehab committed
65
  - production
Florent Chehab's avatar
Florent Chehab committed
66 67
  tags:
    - docker