.gitlab-ci.yml 1 KB
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1 2
testing:
  stage: test
Florent Chehab's avatar
Florent Chehab committed
3 4 5
  image: python:3.6.5-jessie
  services:
    - postgres:9.6.8
Florent Chehab's avatar
Florent Chehab committed
6
  script:
Florent Chehab's avatar
Florent Chehab committed
7
    - export ENV=development
Florent Chehab's avatar
Florent Chehab committed
8
    - export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app
Florent Chehab's avatar
Florent Chehab committed
9
    - pip install -r requirements.txt --quiet
Florent Chehab's avatar
Florent Chehab committed
10 11 12 13 14 15 16 17 18 19 20
    - ./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
21 22
flake8:
  stage: test
Florent Chehab's avatar
Florent Chehab committed
23
  image: python:3.6.5-jessie
Florent Chehab's avatar
Florent Chehab committed
24
  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
pages:
  stage: deploy
  dependencies:
    - testing
  script:
35 36 37 38
    - mkdir .public
    - mv htmlcov/ .public/coverage
    - mv docs/ .public/docs
    - mv .public public
Florent Chehab's avatar
Florent Chehab committed
39 40 41 42
  artifacts:
    paths:
      - public
    expire_in: 1 month
Florent Chehab's avatar
Florent Chehab committed
43 44
  only: 
    - master
Florent Chehab's avatar
Florent Chehab committed
45 46
  tags:
    - docker
Florent Chehab's avatar
Florent Chehab committed
47 48 49 50 51 52 53 54 55 56 57

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