forked from HEIG-GAPS/slyum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
324 lines (301 loc) · 14.4 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
#include:
# - template: Security/SAST.gitlab-ci.yml
# - template: Security/Secret-Detection.gitlab-ci.yml
variables:
MAVEN_CLI_OPTS: "--batch-mode -Dmaven.javadoc.skip=true --settings maven.xml"
SONAR_CLI_OPTS: "-Dsonar.gitlab.api_version=v4 -Dsonar.host.url=$SONARQUBE_URL -Dsonar.login=$SONAR_TOKEN -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.gitlab.project_id=$CI_PROJECT_ID -Dsonar.gitlab.url=$GITLAB_URL -Dsonar.gitlab.user_token=$GL_TOKEN"
DEPLOY_CLI_OPTS: "-DskipTests=true -DGITLAB-NEXUS-USERNAME=$NEXUS_USERNAME -DGITLAB-NEXUS-PASSWORD=$NEXUS_PASSWORD"
stages:
# - complience
- build
# - test
# - quality
- deployment
# dependencies_check:
# stage: complience
# tags:
# - maven-java17
# script: mvn $MAVEN_CLI_OPTS clean dependency:analyze-only dependency:analyze-dep-mgt versions:use-latest-releases versions:update-properties scm:check-local-modification
# checkstyle_check:
# stage: complience
# tags:
# - maven-java17
# script: mvn $MAVEN_CLI_OPTS clean checkstyle:check
build:
stage: build
tags:
- maven-java17
script: mvn $MAVEN_CLI_OPTS -Dmaven.test.skip=true -Dmaven.repo.local=./.m2/repository clean compile package
artifacts:
expire_in: 1 day
paths:
- .m2/
- target/
#spotbugs-sast:
# dependencies:
# - build
# variables:
# MAVEN_REPO_PATH: ./.m2/repository
# COMPILE: "false"
# artifacts:
# expire_in: 1 day
# reports:
# sast: gl-sast-report.json
# test:
# stage: test
# tags:
# - maven-java17
# script:
# - mvn $MAVEN_CLI_OPTS test
# - cat target/site/jacoco/index.html
# artifacts:
# expire_in: 1 day
# reports:
# junit: target/surefire-reports/TEST-*.xml
#quality_check_master:
# stage: quality
# tags:
# - maven-java17
# only:
# - master
# script: mvn $MAVEN_CLI_OPTS clean test sonar:sonar $SONAR_CLI_OPTS
#quality_check_branches:
# stage: quality
# tags:
# - maven-java17
# except:
# - master
# script:
# - git checkout origin/master
# - git merge $CI_COMMIT_SHA --no-commit --no-ff
# - mvn $MAVEN_CLI_OPTS clean test sonar:sonar $SONAR_CLI_OPTS
#deploy_snapshot:
# stage: deployment
# tags:
# - maven-java17
# only:
# - master
# script: mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS deploy
#deploy_release:
# stage: deployment
# tags:
# - maven-java17
# only:
# - tags
# script: mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS deploy
deploy_snapshot_macos_x86_64_monterey:
stage: deployment
tags:
- maven-java17-macos-x86_64-monterey
only:
- master
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type pkg --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --mac-package-identifier "ch.heig.gaps.Slyum" --about-url "https://gaps.heig-vd.ch" --mac-package-name Slyum --input target --icon tools/icns/slyum.icns
- mv Slyum*.pkg Slyum-$FULL_VERSION-x86_64-monterey.pkg
artifacts:
paths:
- "*.pkg"
expire_in: 1 days
deploy_release_macos_x86_64_monterey:
stage: deployment
tags:
- maven-java17-macos-x86_64-monterey
only:
- tags
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type pkg --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --mac-package-identifier "ch.heig.gaps.Slyum" --about-url "https://gaps.heig-vd.ch" --mac-package-name Slyum --input target --icon tools/icns/slyum.icns
- mv Slyum*.pkg Slyum-$FULL_VERSION-x86_64-monterey.pkg
artifacts:
paths:
- "*.pkg"
expire_in: 1 days
deploy_snapshot_macos_x86_64_ventura:
stage: deployment
tags:
- maven-java17-macos-x86_64-ventura
only:
- master
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type pkg --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --mac-package-identifier "ch.heig.gaps.Slyum" --about-url "https://gaps.heig-vd.ch" --mac-package-name Slyum --input target --icon tools/icns/slyum.icns
- mv Slyum*.pkg Slyum-$FULL_VERSION-x86_64-ventura.pkg
artifacts:
paths:
- "*.pkg"
expire_in: 1 days
deploy_release_macos_x86_64_ventura:
stage: deployment
tags:
- maven-java17-macos-x86_64-ventura
only:
- tags
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type pkg --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --mac-package-identifier "ch.heig.gaps.Slyum" --about-url "https://gaps.heig-vd.ch" --mac-package-name Slyum --input target --icon tools/icns/slyum.icns
- mv Slyum*.pkg Slyum-$FULL_VERSION-x86_64-ventura.pkg
artifacts:
paths:
- "*.pkg"
expire_in: 1 days
deploy_snapshot_macos_aarch64:
stage: deployment
tags:
- maven-java17-macos-aarch64
only:
- master
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type pkg --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --mac-package-identifier "ch.heig.gaps.Slyum" --about-url "https://gaps.heig-vd.ch" --mac-package-name Slyum --input target --icon tools/icns/slyum.icns
- mv Slyum*.pkg Slyum-$FULL_VERSION-aarch64.pkg
artifacts:
paths:
- "*.pkg"
expire_in: 1 days
deploy_release_macos_aarch64:
stage: deployment
tags:
- maven-java17-macos-aarch64
only:
- tags
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type pkg --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --mac-package-identifier "ch.heig.gaps.Slyum" --about-url "https://gaps.heig-vd.ch" --mac-package-name Slyum --input target --icon tools/icns/slyum.icns
- mv Slyum*.pkg Slyum-$FULL_VERSION-aarch64.pkg
artifacts:
paths:
- "*.pkg"
expire_in: 1 days
deploy_snapshot_windows:
stage: deployment
tags:
- maven-java17-windows
only:
- master
script:
- mvn $(MAVEN_CLI_OPTS) $(DEPLOY_CLI_OPTS) package
- $FULL_VERSION = mvn help:evaluate -Dexpression="project.version" -q -DforceStdout
- $VERSION = mvn help:evaluate -Dexpression="project.version" -q -DforceStdout | %{ $_.Split('-')[0]; }
- $DESCRIPTION = mvn help:evaluate -Dexpression="project.description" -q -DforceStdout
- $ARTIFACTID = mvn help:evaluate -Dexpression="project.artifactId" -q -DforceStdout
- jpackage --name Slyum --type msi --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --about-url "https://gaps.heig-vd.ch" --input target --icon tools\icns\slyum.ico --win-dir-chooser --win-menu --win-menu-group "Slyum" --win-per-user-install
- mv Slyum*.msi Slyum-$FULL_VERSION-x86_64.msi
artifacts:
paths:
- "*.msi"
expire_in: 1 days
deploy_release_windows:
stage: deployment
tags:
- maven-java17-windows
only:
- tags
script:
- mvn $(MAVEN_CLI_OPTS) $(DEPLOY_CLI_OPTS) package
- $FULL_VERSION = mvn help:evaluate -Dexpression="project.version" -q -DforceStdout
- $VERSION = mvn help:evaluate -Dexpression="project.version" -q -DforceStdout | %{ $_.Split('-')[0]; }
- $DESCRIPTION = mvn help:evaluate -Dexpression="project.description" -q -DforceStdout
- $ARTIFACTID = mvn help:evaluate -Dexpression="project.artifactId" -q -DforceStdout
- jpackage --name Slyum --type msi --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --about-url "https://gaps.heig-vd.ch" --input target --icon tools\icns\slyum.ico --win-dir-chooser --win-menu --win-menu-group "Slyum" --win-per-user-install
- mv Slyum*.msi Slyum-$FULL_VERSION-x86_64.msi
artifacts:
paths:
- "*.msi"
expire_in: 1 days
deploy_snapshot_linux_rpm:
stage: deployment
tags:
- maven-java17-linux
only:
- master
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type rpm --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --about-url "https://gaps.heig-vd.ch" --input target --icon tools/icns/slyum.ico --linux-package-name Slyum --linux-deb-maintainer [email protected] --linux-menu-group Slyum
- mv Slyum*.rpm Slyum-$FULL_VERSION-x86_64.rpm
artifacts:
paths:
- "*.rpm"
expire_in: 1 days
deploy_release_linux_rpm:
stage: deployment
tags:
- maven-java17-linux
only:
- tags
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type rpm --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --about-url "https://gaps.heig-vd.ch" --input target --icon tools/icns/slyum.ico --linux-package-name Slyum --linux-deb-maintainer [email protected] --linux-menu-group Slyum
- mv Slyum*.rpm Slyum-$FULL_VERSION-x86_64.rpm
artifacts:
paths:
- "*.rpm"
expire_in: 1 days
deploy_snapshot_linux_deb:
stage: deployment
tags:
- maven-java17-linux
only:
- master
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type deb --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --about-url "https://gaps.heig-vd.ch" --input target --icon tools/icns/slyum.iconset/icon_512x512.png --linux-deb-maintainer [email protected] --linux-menu-group Slyum
- mv slyum*.deb slyum-$FULL_VERSION-x86_64.deb # /!\ package generated with a lowercase
artifacts:
paths:
- "*.deb"
expire_in: 1 days
deploy_release_linux_deb:
stage: deployment
tags:
- maven-java17-linux
only:
- tags
script:
- mvn $MAVEN_CLI_OPTS $DEPLOY_CLI_OPTS package
- FULL_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | awk -F '-' '{ print $1 }')
- DESCRIPTION=$(mvn help:evaluate -Dexpression=project.description -q -DforceStdout)
- ARTIFACTID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
- jpackage --name Slyum --type deb --main-class swing.Slyum --main-jar $ARTIFACTID-$FULL_VERSION.jar --app-version "$VERSION" --copyright "©HEIG-VD // GAPS 2023" --description "$DESCRIPTION" --about-url "https://gaps.heig-vd.ch" --input target --icon tools/icns/slyum.iconset/icon_512x512.png --linux-deb-maintainer [email protected] --linux-menu-group Slyum
- mv slyum*.deb slyum-$FULL_VERSION-x86_64.deb # /!\ package generated with a lowercase
artifacts:
paths:
- "*.deb"
expire_in: 1 days