.gitlab-ci.yml 1.01 KB
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
image: python:3.6.5-jessie

testing:
  stage: test
  script:
    - 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
test    
Florent Chehab committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    
codequality:
  image: docker:latest
  variables:
    DOCKER_DRIVER: overlay
  services:
    - docker:dind
  script:
    - docker pull codeclimate/codeclimate
    - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    - docker run
      --env SOURCE_CODE="$PWD" \
      --volume "$PWD":/code \
      --volume /var/run/docker.sock:/var/run/docker.sock \
      "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
  artifacts:
    paths: [codeclimate.json]
Florent Chehab's avatar
Florent Chehab committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

pages:
  stage: deploy
  dependencies:
    - testing
  script:
    - mv htmlcov/ public/
  artifacts:
    paths:
      - public
    expire_in: 1 month
  only: 
    - master
  tags:
    - docker