.gitlab-ci.yml 1.64 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
  ENV: DEV
  SECRET_KEY: stupid_key_for_CI
10
11
  DJANGO_ADMIN_USERNAME: admin
  DJANGO_ADMIN_PASSWORD: admin
Florent Chehab's avatar
Florent Chehab committed
12
13
14
15
16
  POSTGRES_DB: postgres
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: postgres
  DB_HOST: postgres
  DB_PORT: 5432
Florent Chehab's avatar
Florent Chehab committed
17

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

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

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

Florent Chehab's avatar
Florent Chehab committed
66
eslint:
Florent Chehab's avatar
Florent Chehab committed
67
68
69
70
71
72
73
  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
74
  script:
Florent Chehab's avatar
Florent Chehab committed
75
    - npm run lint
Florent Chehab's avatar
Florent Chehab committed
76
77
78
  tags:
    - docker

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