forked from akvorado/akvorado
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
93 lines (89 loc) · 2.44 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
---
stages:
- tests
- build
run tests:
stage: tests
image: golang:1.21-alpine
cache:
- key:
files:
- go.sum
paths:
- .go-cache/
- bin/
- key:
files:
- console/frontend/package-lock.json
paths:
- .npm-cache
variables:
FF_NETWORK_PER_BUILD: "true"
CI_AKVORADO_FUNCTIONAL_TESTS: "true"
# zookeeper
ALLOW_ANONYMOUS_LOGIN: "yes"
# kafka
KAFKA_ZOOKEEPER_PROTOCOL: PLAINTEXT
KAFKA_CFG_BROKER_ID: "1"
KAFKA_CFG_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_CFG_LISTENERS: CLIENT://:9092,EXTERNAL://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_CFG_ADVERTISED_LISTENERS: CLIENT://kafka:9092,EXTERNAL://localhost:9092
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: CLIENT
# redis
ALLOW_EMPTY_PASSWORD: "yes"
services:
- name: bitnami/zookeeper:3.8
alias: zookeeper
- name: bitnami/kafka:3.5
alias: kafka
- name: bitnami/redis:7.0
alias: redis
- name: clickhouse/clickhouse-server:23.8
alias: clickhouse
script:
- time apk add --no-cache git make gcc musl-dev shared-mime-info npm curl
- export GOMODCACHE=$PWD/.go-cache
- npm config --user set cache $PWD/.npm-cache
- time go mod download
- time make && ./bin/akvorado version
- time make test-race
- time make test-js
- time make test-coverage
coverage: '/Code coverage: [0-9.]+/'
artifacts:
reports:
junit:
- test/go/tests.xml
- test/js/tests.xml
coverage_report:
coverage_format: cobertura
path: test/go/coverage.xml
# To execute manually:
# gitlab-runner exec docker "run tests"
build docker image:
stage: build
image: docker:stable
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_MERGE_REQUEST_ID
script:
- |
mkdir -p ~/.docker
cat <<EOF > ~/.docker/config.json
{
"proxies":
{
"default":
{
"httpProxy": "$http_proxy",
"httpsProxy": "$https_proxy",
"noProxy": "127.0.0.1/8${NO_PROXY:+,}NO_PROXY${no_proxy:+,}$no_proxy"
}
}
}
EOF
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -f docker/Dockerfile -t $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_ID .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH$CI_MERGE_REQUEST_ID