-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
69 lines (62 loc) · 1.65 KB
/
.gitlab-ci.yml
File metadata and controls
69 lines (62 loc) · 1.65 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
variables:
JAVA_DOCKER_IMAGE: "$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/eclipse-temurin:17-alpine"
MAVEN_OPTS: >-
-Dhttps.protocols=TLSv1.2
-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true
MAVEN_CLI_OPTS: >-
--batch-mode
--errors
--fail-at-end
--show-version
--no-transfer-progress
-DinstallAtEnd=true
-DdeployAtEnd=true
# image: openjdk:17 # openjdk:* is deprecated! See https://hub.docker.com/_/openjdk
image: $JAVA_DOCKER_IMAGE
cache:
paths:
- $CI_PROJECT_DIR/.m2/repository
stages:
- build
- test
- deploy
# Verify merge requests
test:
stage: test
script:
- ./mvnw $MAVEN_CLI_OPTS clean verify
javadocs:
stage: build
script:
- ./mvnw $MAVEN_CLI_OPTS javadoc:aggregate
artifacts:
paths:
- target/site/apidocs
# deploy using ci_settings.xml as maven settings
# see https://gitlab.com/help/user/packages/maven_repository/index.md#creating-maven-packages-with-gitlab-cicd-using-maven
push-packages:
stage: deploy
script:
- ./mvnw -Drevision=$CI_COMMIT_TAG -Dchangelist="" $MAVEN_CLI_OPTS verify
- ./mvnw -Drevision=$CI_COMMIT_TAG -Dchangelist="" $MAVEN_CLI_OPTS deploy -s ci_settings.xml
only:
# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/27818
variables:
- $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/
pages:
stage: deploy
script:
- mkdir -p public
- ls -la
- cp -rv target/site/* public/
needs:
- javadocs
artifacts:
paths:
- public
only:
# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/27818
variables:
- $CI_COMMIT_TAG =~ /^\d+.\d+.\d+$/