-
Notifications
You must be signed in to change notification settings - Fork 11
/
.gitlab-ci.yml
247 lines (232 loc) · 6.85 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
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
image: alpine
variables:
SBT_OPTS: "-Dglobal.base=sbt-cache/sbtboot -Dsbt.boot.directory=sbt-cache/boot -Dsbt.ivy.home=sbt-cache/ivy -Divy.home=${CI_PROJECT_DIR}/sbt-cache/ivy -Dsbt.ci=true"
COURSIER_CACHE: sbt-cache/coursier
UNPRIVILEGED_USER: "tester"
stages:
- censor # first censor cause it's faster
- waspctl
- test
- integration
- deploy
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- "sbt-cache/ivy/cache"
- "sbt-cache/boot"
- "sbt-cache/sbtboot"
- "sbt-cache/target"
- "sbt-cache/coursier"
- node_modules/
- public/
# Node modules and dependencies
test-kernel:
stage: test
interruptible: true
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
parallel:
matrix:
- WASP_FLAVOR: [ "VANILLA2", "VANILLA2_2_12", "EMR_2_12", "CDP719", "EMR_6_13"]
script:
- ./run-sbt-unprivileged.sh "clean coverageOn wasp-kernel/test coverageOff wasp-kernel/coverageReport wasp-kernel/coverageAggregate"
after_script:
- mkdir test-output
- find . -path '*/test-reports/*.xml' -exec cp '{}' ./test-output/ \;
artifacts:
reports:
junit: 'test-output/*.xml'
coverage_report:
coverage_format: cobertura
path: 'target/scala-2.*/coverage-report/cobertura.xml'
tags:
- gitlab-org
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
needs: []
test-plugin:
stage: test
interruptible: true
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
parallel:
matrix:
- WASP_FLAVOR: [ "VANILLA2", "VANILLA2_2_12", "EMR_2_12", "CDP719", "EMR_6_13"]
script:
- ./run-sbt-unprivileged.sh "clean coverageOn wasp-plugin/test coverageOff wasp-plugin/coverageReport wasp-plugin/coverageAggregate"
after_script:
- ls -R ${CI_PROJECT_DIR}/sbt-cache/ivy/jars/
- mkdir test-output
- find . -path '*/test-reports/*.xml' -exec cp '{}' ./test-output/ \;
artifacts:
reports:
junit: 'test-output/*.xml'
coverage_report:
coverage_format: cobertura
path: 'target/scala-2.*/coverage-report/cobertura.xml'
tags:
- gitlab-org
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
needs: []
test-repo:
stage: test
interruptible: true
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
parallel:
matrix:
- WASP_FLAVOR: [ "VANILLA2", "VANILLA2_2_12", "EMR_2_12", "CDP719", "EMR_6_13"]
script:
- ./run-sbt-unprivileged.sh "clean coverageOn wasp-repository/test coverageOff wasp-repository/coverageReport wasp-repository/coverageAggregate"
after_script:
- mkdir test-output
- find . -path '*/test-reports/*.xml' -exec cp '{}' ./test-output/ \;
artifacts:
reports:
junit: 'test-output/*.xml'
coverage_report:
coverage_format: cobertura
path: 'target/scala-2.*/coverage-report/cobertura.xml'
tags:
- gitlab-org
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
needs: []
compile-whitelabel:
stage: deploy
interruptible: true
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
parallel:
matrix:
- WASP_FLAVOR: [ "VANILLA2", "VANILLA2_2_12", "EMR_2_12", "CDP719", "EMR_6_13"]
script:
- ./run-sbt-unprivileged.sh "clean wasp-whitelabel/test"
tags:
- gitlab-org
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
needs: []
censor:
stage: censor
interruptible: true
image: "registry.gitlab.com/agilefactory/developers/censor:0.1.0"
only: [merge_requests]
script:
- ./censor.sh
generate-open-api:
stage: test
interruptible: true
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
script:
- ./run-sbt-unprivileged.sh "generateOpenApi"
tags:
- gitlab-org
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
- tags
artifacts:
paths: ['documentation/wasp-openapi.yaml']
needs: []
waspctl:
interruptible: true
stage: deploy
image: "registry.gitlab.com/agilefactory/agile.wasp2/waspctl-build:0.2.0"
script:
- bash waspctl/build-for-all-archs.bash
artifacts:
paths: ['waspctl/output']
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
- tags
needs:
- generate-open-api
dependencies:
- generate-open-api
snapshot:
interruptible: false
stage: deploy
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
parallel:
matrix:
- WASP_FLAVOR: [ "VANILLA2", "VANILLA2_2_12", "EMR_2_12", "CDP719", "EMR_6_13"]
tags:
- gitlab-org
script:
- "mkdir -p $HOME/.sbt/gpg"
- "echo $GPG_PUB | base64 -d > $HOME/.sbt/gpg/pubring.asc"
- "echo $GPG_PRIV | base64 -d > $HOME/.sbt/gpg/secring.asc"
- "export PGP_PASSPHRASE=`echo $GPG_PASSPHRASE_BASE64 | base64 -d`"
- sbt clean publishSigned
only:
- /^develop$/
- /(^release\/v([0-9]+)\.([0-9]+))/
- merge_requests
needs:
- test-kernel
- test-repo
- test-plugin
release:
interruptible: false
stage: deploy
image: "registry.gitlab.com/agilefactory/agile.wasp2/sbt:1.9.8-8u402-b06-jdk-jammy"
parallel:
matrix:
- WASP_FLAVOR: [ "VANILLA2", "VANILLA2_2_12", "EMR_2_12", "CDP719", "EMR_6_13"]
script:
- "mkdir -p $HOME/.sbt/gpg"
- "echo $GPG_PUB | base64 -d > $HOME/.sbt/gpg/pubring.asc"
- "echo $GPG_PRIV | base64 -d > $HOME/.sbt/gpg/secring.asc"
- "export PGP_PASSPHRASE=`echo $GPG_PASSPHRASE_BASE64 | base64 -d`"
- sbt clean publishSigned sonatypeBundleRelease
only:
- tags
tags:
- gitlab-org
pages:
image: registry.gitlab.com/publicagilefactory/handbook/node:10
stage: deploy
script:
- npm install gitbook-cli -g # install gitbook
- gitbook fetch 3.2.3 # fetch final stable version
- gitbook install # add any requested plugins in book.json
- |
if [[ $CI_COMMIT_REF_NAME == 'develop' ]]
then
rm -rf public/*
gitbook build documentation public # build to the public path
else
mkdir -p public/$CI_COMMIT_REF_NAME
rm -rf public/$CI_COMMIT_REF_NAME/*
gitbook build documentation public/$CI_COMMIT_REF_NAME
fi
- |
if [[ -n "$CI_MERGE_REQUEST_IID" ]]
then
curl -vvvv -L -X POST --header "Private-Token: $AGILELAB_BOT" --data-urlencode "body=Your merge request has been rendered and can be reviewed at https://agilefactory.gitlab.io/Agile.Wasp2/$CI_COMMIT_REF_NAME/" https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID/notes
else
true
fi
cache:
key: pages
paths:
- node_modules/
- public/
artifacts:
paths:
- public
only:
refs:
- merge_requests
- /^develop$/
changes:
- documentation/*