-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
167 lines (149 loc) · 3.65 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
157
158
159
160
161
162
163
164
165
166
167
stages:
- lint
- local
- container
- docker
workflow:
rules:
- if: $CI_COMMIT_BRANCH
variables:
LE_FQDN: "ci.dev.acuparse.com"
EMAIL: "[email protected]"
TEST_USERNAME: "ci"
TEST_PASSWORD: "P@55w0rd!"
.TEMPLATE:LOCAL:install:
stage: local
before_script:
- apt-get update
- apt-get dist-upgrade -yq
- apt-get install curl jq -yq
script:
- bash tests/installer
artifacts:
paths:
- output
when: on_failure
dependencies: [ ]
needs: [ LINT:bash ]
.TEMPLATE:DOCKER:container:
stage: container
image: alpine:3.16
variables:
MYSQL_ROOT_PASSWORD: P@ssw0rd1234
MYSQL_DATABASE: acuparse
MYSQL_USER: acuparse
MYSQL_PASSWORD: P@ssw0rd1234
MYSQL_HOSTNAME: db
TZ: America/Denver
FF_NETWORK_PER_BUILD: 1
before_script:
- apk --no-cache add curl jq mysql-client bash
- >
while ! mysqladmin ping -h"${MYSQL_HOSTNAME}" -p"${MYSQL_PASSWORD}" --silent; do
echo "Waiting for SQL Container"
((c++)) && ((c==30)) && break
sleep 5
done
- chmod +x tests/installer
script:
- tests/installer container
allow_failure: true
artifacts:
paths:
- output
when: on_failure
dependencies: [ ]
needs: [ LINT:bash ]
.TEMPLATE:DOCKER:install:
stage: docker
variables:
FF_NETWORK_PER_BUILD: 1
before_script:
- apt-get update
- apt-get dist-upgrade -yq
- apt-get install curl -yq
script:
- >
if [ "$CI_COMMIT_BRANCH" != "master" ]; then
sed -i "s/REPO='master'/REPO='"$CI_COMMIT_BRANCH"'/" install_docker
fi
- bash tests/installer docker
artifacts:
paths:
- output
when: on_failure
dependencies: [ ]
needs: [ LINT:bash, LINT:compose ]
LINT:bash:
image: koalaman/shellcheck-alpine
stage: lint
before_script:
- export SHELLCHECK_OPTS="-e SC2034 -e SC2059 -e SC2317"
script:
- shellcheck install
- shellcheck install_docker
- shellcheck docker/acuparse
- shellcheck resources/*
- shellcheck tests/installer
dependencies: [ ]
LINT:markdown:
stage: lint
image: node:latest
before_script:
- npm install -g markdownlint-cli
script:
- markdownlint .
dependencies: [ ]
LINT:compose:
stage: lint
image: docker/compose:latest
script:
- docker-compose -f docker/docker-compose.yml config
dependencies: [ ]
DEBIAN:buster:
extends: .TEMPLATE:LOCAL:install
image: debian:buster
DEBIAN:bullseye:
extends: .TEMPLATE:LOCAL:install
image: debian:bullseye
UBUNTU:focal:
extends: .TEMPLATE:LOCAL:install
image: ubuntu:focal
UBUNTU:jammy:
extends: .TEMPLATE:LOCAL:install
before_script:
- apt-get update
- apt-get dist-upgrade -yq
- apt-get install curl jq -yq
- cp tests/resources/init.d/rsyslog /etc/init.d/rsyslog && chmod +x /etc/init.d/rsyslog
image: ubuntu:jammy
DEV:CONTAINER:
extends: .TEMPLATE:DOCKER:container
services:
- name: registry.gitlab.com/acuparse/mariadb/dev:latest
alias: db
- name: registry.gitlab.com/acuparse/acuparse/dev:latest
alias: acuparse
rules:
- if: '$CI_COMMIT_BRANCH != "master"'
CONTAINER:
extends: .TEMPLATE:DOCKER:container
services:
- name: registry.gitlab.com/acuparse/mariadb:latest
alias: db
- name: registry.gitlab.com/acuparse/acuparse:latest
alias: acuparse
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
DOCKER:DEBIAN:buster:
extends: .TEMPLATE:DOCKER:install
image: debian:buster
DOCKER:DEBIAN:bullseye:
extends: .TEMPLATE:DOCKER:install
image: debian:bullseye
DOCKER:UBUNTU:focal:
extends: .TEMPLATE:DOCKER:install
image: ubuntu:focal
DOCKER:UBUNTU:jammy:
extends: .TEMPLATE:DOCKER:install
image: ubuntu:jammy