This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (100 loc) · 2.51 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
image: golang:1.19-buster
stages:
- build
- test
- broker
- simulation
.gobuild:
stage: build
before_script:
- go version
script:
- make build
go1.18 build:
image: golang:1.18-buster
extends: .gobuild
go1.19 build:
image: golang:1.19-buster
extends: .gobuild
test luavm:
stage: test
services:
- postgres:13
- redis:6-alpine
variables:
POSTGRES_DB: gosd
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
DATABASE_URL: "postgres://postgres:password@postgres/gosd?sslmode=disable"
REDIS_URL: "redis://redis:6379/5"
before_script:
- go version
script:
- go run main.go database migrate
- go run main.go database seed
- make test-luavm
.test-broker:
script:
- apt-get update -y && apt-get install -y mosquitto-clients redis-server
- make test-broker
# Must Mosquitto >= 1.6
# https://github.com/eclipse/mosquitto/blob/master/ChangeLog.txt#L616
test mosquitto 1.6:
stage: broker
services:
- redis:latest
- name: eclipse-mosquitto:1.6
variables:
REDIS_URL: "redis://redis:6379"
MQTT_URL: "mqtt://eclipse-mosquitto:1883"
extends: .test-broker
# Must Mosquitto >= 2.0.8
# https://github.com/eclipse/mosquitto/issues/2040
test mosquitto 2.0:
stage: broker
services:
- redis:latest
- name: eclipse-mosquitto:2.0.8
command:
- "mosquitto"
- "-c"
- "/mosquitto-no-auth.conf"
variables:
REDIS_URL: "redis://redis:6379"
MQTT_URL: "mqtt://eclipse-mosquitto:1883"
extends: .test-broker
test emqx 4.4:
stage: broker
services:
- redis:latest
- name: emqx:4.4
alias: emqx
variables:
REDIS_URL: "redis://redis:6379"
MQTT_URL: "mqtt://emqx:1883"
extends: .test-broker
test-simulation:
stage: simulation
services:
- eclipse-mosquitto:1.6
- postgres:13
- redis:latest
variables:
MQTT_URL: "mqtt://eclipse-mosquitto:1883"
POSTGRES_DB: gosd
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
DATABASE_URL: "postgres://postgres:password@postgres/gosd?sslmode=disable"
REDIS_URL: "redis://redis:6379"
before_script:
# - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/sbim/superdock/cloud/ncp.git".insteadOf git@gitlab.com:sbim/superdock/cloud/ncp.git
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/sbim/superdock/cloud/ncp.git
- cd ncp
- make
- make install
- cd ..
script:
- make
- ./gosd database migrate
- ./gosd database seed
- make test-simulation