-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
256 lines (243 loc) · 6.32 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
256 lines (243 loc) · 6.32 KB
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
stages:
- test
- report
- deploy
image: docker:24.0.7
variables:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
RUN_TESTS_CORE:
value: "TRUE"
options:
- "FALSE"
- "TRUE"
description: "Run core tests"
RUN_TESTS_PART1:
value: "TRUE"
options:
- "FALSE"
- "TRUE"
description: "Run examples of tests part1"
RUN_TESTS_BROKERS:
value: "TRUE"
options:
- "FALSE"
- "TRUE"
description: "Run examples of tests with brokers"
RUN_TESTS_DB:
value: "TRUE"
options:
- "FALSE"
- "TRUE"
description: "Run examples of tests with databases"
RUN_TESTS_NOSQL:
value: "TRUE"
options:
- "FALSE"
- "TRUE"
description: "Run examples of tests with no sql databases"
RUN_TESTS_FAILED_PART1:
value: "TRUE"
options:
- "FALSE"
- "TRUE"
description: "Run examples of failed tests part1"
java-test-core:
services:
- name: docker:24.0.7-dind
alias: docker
command: ["--tls=false"]
stage: test
script:
# - echo 'startup log success' > ${CI_PROJECT_DIR}/java-test/src/test/resources/logs/test.log
- docker-compose -f docker-compose-core.yml up --force-recreate --exit-code-from autotest-example
after_script:
- docker-compose -f docker-compose-core.yml down --remove-orphans
- mkdir -p _output/allure-results
- cp java-test-core/my-build/allure-results/* _output/allure-results
- chmod -R 777 _output/
only: [ web, api, merge_requests, main ]
except:
variables:
- $RUN_TESTS_CORE == "FALSE"
refs:
- tags
artifacts:
when: always
paths:
- ./_output
expire_in: 1 hour
java-test-part1:
services:
- name: docker:24.0.7-dind
alias: docker
command: ["--tls=false"]
variables:
TAG: 'passed'
stage: test
script:
- docker-compose -f docker-compose-part1.yml up --force-recreate --exit-code-from autotest-example
after_script:
- docker-compose -f docker-compose-part1.yml down --remove-orphans
- mkdir -p _output/allure-results
- cp java-test-part1/build/allure-results/* _output/allure-results
- chmod -R 777 _output/
only: [ web, api, merge_requests, main ]
except:
variables:
- $RUN_TESTS_PART1 == "FALSE"
refs:
- tags
artifacts:
when: always
paths:
- ./_output
expire_in: 1 hour
java-test-brokers:
services:
- name: docker:24.0.7-dind
alias: docker
command: ["--tls=false"]
stage: test
script:
- docker-compose -f docker-compose-brokers.yml up --force-recreate --exit-code-from autotest-example
after_script:
- docker-compose -f docker-compose-brokers.yml down --remove-orphans
- mkdir -p _output/allure-results
- cp java-test-brokers/build/allure-results/* _output/allure-results
- chmod -R 777 _output/
only: [ web, api, merge_requests, main ]
except:
variables:
- $RUN_TESTS_BROKERS == "FALSE"
refs:
- tags
artifacts:
when: always
paths:
- ./_output
expire_in: 1 hour
java-test-db:
services:
- name: docker:24.0.7-dind
alias: docker
command: ["--tls=false"]
stage: test
script:
- docker-compose -f docker-compose-db.yml up --force-recreate --exit-code-from autotest-example
after_script:
- docker-compose -f docker-compose-db.yml down --remove-orphans
- mkdir -p _output/allure-results
- cp java-test-db/build/allure-results/* _output/allure-results
- chmod -R 777 _output/
only: [ web, api, merge_requests, main ]
except:
variables:
- $RUN_TESTS_DB == "FALSE"
refs:
- tags
artifacts:
when: always
paths:
- ./_output
expire_in: 1 hour
java-test-nosql:
services:
- name: docker:24.0.7-dind
alias: docker
command: ["--tls=false"]
stage: test
script:
- docker-compose -f docker-compose-nosql.yml up --force-recreate --exit-code-from autotest-example
after_script:
- docker-compose -f docker-compose-nosql.yml down --remove-orphans
- mkdir -p _output/allure-results
- cp java-test-nosql/build/allure-results/* _output/allure-results
- chmod -R 777 _output/
only: [ web, api, merge_requests, main ]
except:
variables:
- $RUN_TESTS_NOSQL == "FALSE"
refs:
- tags
artifacts:
when: always
paths:
- ./_output
expire_in: 1 hour
java-test-part1-failed:
services:
- name: docker:24.0.7-dind
alias: docker
command: ["--tls=false"]
variables:
TAG: 'failed'
stage: test
script:
- echo 'startup log success' > ${CI_PROJECT_DIR}/java-test-part1/src/test/resources/logs/test.log
- docker-compose -f docker-compose-part1.yml up --force-recreate --exit-code-from autotest-example
after_script:
- docker-compose -f docker-compose-part1.yml down --remove-orphans
- mkdir -p _output/allure-results
- cp java-test-part1/build/allure-results/* _output/allure-results
- chmod -R 777 _output/
only: [ web, api, merge_requests, main ]
except:
variables:
- $RUN_TESTS_FAILED_PART1== "FALSE"
refs:
- tags
allow_failure:
exit_codes: 1
artifacts:
when: always
paths:
- ./_output
expire_in: 1 hour
tests-report:
image: frankescobar/allure-docker-service:2.21.0
stage: report
script:
- allure generate --clean _output/allure-results --report-dir _output/allure-report
after_script:
- echo https://$CI_PROJECT_ROOT_NAMESPACE.gitlab.io/-/$CI_PROJECT_TITLE/-/jobs/$CI_JOB_ID/artifacts/_output/allure-report/index.html
only: [ web, api, merge_requests, main ]
except:
- tags
when: always
needs:
- job: java-test-core
optional: true
artifacts: true
- job: java-test-part1
optional: true
artifacts: true
- job: java-test-brokers
optional: true
artifacts: true
- job: java-test-db
optional: true
artifacts: true
- job: java-test-nosql
optional: true
artifacts: true
- job: java-test-part1-failed
optional: true
artifacts: true
artifacts:
when: always
paths:
- ./_output
expire_in: 7 day
pages:
stage: deploy
dependencies: [ "tests-report" ]
script:
- mkdir public
- mv ./_output/allure-report/* public
only: [ main ]
except:
- tags
artifacts:
paths:
- public