-
Notifications
You must be signed in to change notification settings - Fork 21
/
.gitlab-ci.yml
102 lines (90 loc) · 1.94 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
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
stages:
- check
- test
- build
- package
- publish
services:
- postgres:latest
variables:
CONTAINER_PYTHON_IMAGE: python:3.9
CONTAINER_NODE_IMAGE: node:17
POSTGRES_DB: bounca
POSTGRES_USER: bounca
POSTGRES_PASSWORD: changeit
REGEX_RELEASE: /^release*$/
.release_only: &release_only
only:
- /^release*/
except:
- tags
check-backend:
stage: check
image: $CONTAINER_PYTHON_IMAGE
before_script:
- python --version
- pip install virtualenv
- virtualenv env
- source ./env/bin/activate
- pip install -r requirements.txt
script:
- bash -xe run-checks-python.sh
artifacts:
expire_in: 2 hrs
paths:
- env
check-front:
stage: check
image: $CONTAINER_NODE_IMAGE
script:
- bash -xe run-checks-node.sh
artifacts:
expire_in: 2 hrs
paths:
- front/node_modules
- front/package-lock.json
test-backend:
stage: test
image: $CONTAINER_PYTHON_IMAGE
dependencies:
- check-backend
script:
- mkdir -p /var/log/bounca/
- cp ./etc/bounca/services.yaml.example ./etc/bounca/services.yaml
- bash -xe run-tests.sh
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
build-front:
stage: build
image: $CONTAINER_NODE_IMAGE
script:
- bash -xe build-front.sh
dependencies:
- check-front
artifacts:
name: $CI_COMMIT_REF_NAME
paths:
- front/dist
package:
stage: package
image: $CONTAINER_PYTHON_IMAGE
dependencies:
- build-front
script:
- bash -xe build-package.sh
artifacts:
paths:
- bounca.tar.gz
publish:
<<: *release_only
stage: publish
image: curlimages/curl:latest
dependencies:
- package
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./bounca.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_COMMIT_REF_NAME}/bounca.tar.gz"'