.gitlab-ci.yml 1.1 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
    - ./manage.py check
17
    - pytest -n 4 general/ frontend/ backend/ --cov-report html
Florent Chehab's avatar
Florent Chehab committed
18
19
20
21
22
23
24
  artifacts:
    paths:
      - htmlcov/
    expire_in: 1 month
  tags:
    - docker

Florent Chehab's avatar
linting  
Florent Chehab committed
25
flake8:
26
  stage: syntaxe
Florent Chehab's avatar
Florent Chehab committed
27
  image: python:3.6.5-jessie
Florent Chehab's avatar
linting  
Florent Chehab committed
28
  script:
Florent Chehab's avatar
clean  
Florent Chehab committed
29
    - pip install flake8
Florent Chehab's avatar
linting  
Florent Chehab committed
30
31
32
33
    - flake8
  tags:
    - docker

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

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
63
  - production
Florent Chehab's avatar
Florent Chehab committed
64
65
  tags:
    - docker