.gitlab-ci.yml 915 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 ENV=development
Florent Chehab's avatar
Florent Chehab committed
10
    - export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app
Florent Chehab's avatar
Florent Chehab committed
11
    - pip install -r requirements.txt --quiet
Florent Chehab's avatar
Florent Chehab committed
12
13
14
15
16
17
18
19
20
21
22
    - ./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
linting  
Florent Chehab committed
23
24
25
flake8:
  stage: test
  script:
Florent Chehab's avatar
clean  
Florent Chehab committed
26
    - pip install flake8
Florent Chehab's avatar
linting  
Florent Chehab committed
27
28
29
30
    - flake8
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
pages:
  stage: deploy
  dependencies:
    - testing
  script:
    - mv htmlcov/ public/
  artifacts:
    paths:
      - public
    expire_in: 1 month
  only: 
    - master
  tags:
    - docker
Florent Chehab's avatar
Florent Chehab committed
45
46
47
48
49
50
51
52
53
54
55

preprod:
  type: deploy
  image: ruby
  script:
  - gem install dpl
  - dpl --provider=heroku --app=outgoing-preprod --api-key=$HEROKU_API_KEY
  only:
  - master
  tags:
    - docker