-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
156 lines (145 loc) · 3.25 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
services:
- name: docker.elastic.co/elasticsearch/elasticsearch:7.10.0
alias: elasticsearch
command: [ "bin/elasticsearch", "-Ediscovery.type=single-node" ]
- name: minio/minio
alias: minio
#
# - name: postgres:latest
# alias: postgres
variables:
ELASTICSEARCH_URL: "http://elasticsearch:9200"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
POSTGRES_NAME: "postgres"
POSTGRES_PORT: 5432
POSTGRES_DB: "enki-tests"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "pg-password"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
MINIO_ENDPOINT: "minio"
MINIO_ACCESS_KEY: "MINIOACCESSKEY"
MINIO_SECRET_KEY: "MINIO_SECRET_KEY"
stages:
- install
- build-test
- deploy
cache:
paths:
- fronts/node_modules/
- backend/venv/
- .cache/pip
install-fronts-dependencies:
image: node:latest
stage: install
script:
- cd fronts
- echo "Installing packages..."
- npm install
artifacts:
paths:
- fronts/node_modules/
only:
refs:
- merge_requests
changes:
- fronts/*
install-backend-dependencies:
image: python:3.8
stage: install
script:
- cd backend
- echo "Installing python env and requirements..."
- python3 -m venv venv
- source venv/bin/activate
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r requirements.dev.txt
- pip install -e .
only:
refs:
- merge_requests
changes:
- backend/*
artifacts:
paths:
- backend/venv/
install-cisu-package-dependencies:
image: python:3.8-alpine
stage: install
script:
- cd cisu
- echo "Installing python env and requirements..."
- python3 -m venv venv
- source venv/bin/activate
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r requirements.test.txt
- pip install -e .
artifacts:
paths:
- cisu/venv/
only:
refs:
- merge_requests
changes:
- cisu/*
front-enki-build-and-test:
image: node:latest
stage: build-test
script:
- cd fronts
- echo "Building enki front app..."
# - npm run build enki
# - echo "Testing enki front app..."
# - npm test enki
only:
refs:
- merge_requests
changes:
- fronts/*
back-build-and-test:
image: python:3.8
stage: build-test
script:
- cd backend
- source venv/bin/activate
- echo "Unit testing..."
- pytest src/tests/unit
- echo "Integration testing..."
- pytest src/tests/integration
- echo "Flask e2e testing..."
- pytest src/tests/e2e
only:
refs:
- merge_requests
changes:
- backend/*
cisu-build-and-test:
image: python:3.8-alpine
stage: build-test
script:
- cd cisu
- source venv/bin/activate
- echo "Unit testing..."
- pytest tests/unit
only:
refs:
- merge_requests
changes:
- cisu/*
#cisu-deploy-package:
# stage: deploy
# image: python:3.8-alpine
# script:
# - cd cisu
# - cat $PYPIRC > /tmp/.pypirc
# - sed -i 's/PYPI_TOKEN_TO_RELACE/$PYPI_TOKEN/' /tmp/.pypirc
# - sed /tmp/.pypirc
# - pip install twine
# - python setup.py bdist_wheel
# - python -m twine upload --repository pypi dist/* --config-file /tmp/.pypirc
# only:
# refs:
# - merge_requests
# changes:
# - cisu/*