.gitlab-ci.yml 1.58 KB
Newer Older
1
stages:
Florent Chehab's avatar
Florent Chehab committed
2
  - check
3
  - test
Florent Chehab's avatar
Florent Chehab committed
4
  - lint
5
  - documentation
6

Florent Chehab's avatar
Florent Chehab committed
7
variables:
Florent Chehab's avatar
Florent Chehab committed
8 9 10 11 12 13 14
  ENV: DEV
  SECRET_KEY: stupid_key_for_CI
  POSTGRES_DB: postgres
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: postgres
  DB_HOST: postgres
  DB_PORT: 5432
Florent Chehab's avatar
Florent Chehab committed
15

Florent Chehab's avatar
Florent Chehab committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

check_back:
  stage: check
  image: registry.gitlab.utc.fr/rex-dri/rex-dri/backend
  services:
    - postgres:10.5
  script:
    - cd backend
    - ./manage.py check
  tags:
    - docker

check_front:
  stage: check
  image: node:10.15.1-alpine
  cache:
    paths:
      - frontend/node_modules/
  before_script:
    - cd frontend && npm i
  script:
    - npm run build
  tags:
    - docker

test_back:
Florent Chehab's avatar
Florent Chehab committed
42
  stage: test
Florent Chehab's avatar
Florent Chehab committed
43
  image: registry.gitlab.utc.fr/rex-dri/rex-dri/backend
Florent Chehab's avatar
Florent Chehab committed
44
  services:
Florent Chehab's avatar
Florent Chehab committed
45
    - postgres:10.5
Florent Chehab's avatar
Florent Chehab committed
46
  script:
Florent Chehab's avatar
Florent Chehab committed
47 48
    - cd backend
    - pytest base_app/ frontend_app/ backend_app/ --cov-report html
Florent Chehab's avatar
Florent Chehab committed
49 50
  artifacts:
    paths:
51
      - backend/htmlcov/
Florent Chehab's avatar
Florent Chehab committed
52 53 54 55
    expire_in: 1 month
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
56
flake8:
Florent Chehab's avatar
Florent Chehab committed
57 58
  stage: lint
  image: registry.gitlab.utc.fr/rex-dri/rex-dri/backend
Florent Chehab's avatar
Florent Chehab committed
59
  script:
60
    - cd backend && flake8
Florent Chehab's avatar
Florent Chehab committed
61 62 63
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
64
eslint:
Florent Chehab's avatar
Florent Chehab committed
65 66 67 68 69 70 71
  stage: lint
  image: node:10.15.1-alpine
  cache:
    paths:
      - frontend/node_modules/
  before_script:
    - cd frontend && npm i
Florent Chehab's avatar
Florent Chehab committed
72
  script:
Florent Chehab's avatar
Florent Chehab committed
73
    - npm run lint
Florent Chehab's avatar
Florent Chehab committed
74 75 76
  tags:
    - docker

Florent Chehab's avatar
Florent Chehab committed
77
pages:
78
  stage: documentation
79
  image: floawfloaw/plantuml
Florent Chehab's avatar
Florent Chehab committed
80
  dependencies:
Florent Chehab's avatar
Florent Chehab committed
81
    - test_back
Florent Chehab's avatar
Florent Chehab committed
82
  script:
83
    - mkdir .public
84
    - mv backend/htmlcov/ .public/coverage
85 86
    - make documentation
    - mv documentation/ .public/documentation
87
    - mv .public public
Florent Chehab's avatar
Florent Chehab committed
88 89 90 91
  artifacts:
    paths:
      - public
    expire_in: 1 month
Florent Chehab's avatar
Florent Chehab committed
92
  only:
Florent Chehab's avatar
Florent Chehab committed
93
    - master
Florent Chehab's avatar
Florent Chehab committed
94 95
  tags:
    - docker