This repository was archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
107 lines (96 loc) · 3.14 KB
/
.gitlab-ci.yml
File metadata and controls
107 lines (96 loc) · 3.14 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
image: openjdk:11-jdk
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
# isolated from any previous builds.
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
policy: pull
paths:
- .gradle
stages:
- build
- code-analysis
- test
- coverage
- visualize
- deploy
build:
stage: build
tags:
- exec-docker
script: ./gradlew --build-cache assemble
cache:
policy: push
paths:
- .gradle
artifacts:
paths:
- build
pmd:
stage: code-analysis
tags:
- exec-docker
script: ./gradlew pmdMain
checkstyle:
stage: code-analysis
tags:
- exec-docker
script: ./gradlew checkstyleMain
test:
stage: test
tags:
- exec-docker
script:
- ./gradlew jacocoTestReport
# Print test coverage to console (for coverage badge)
- cat build/reports/jacoco/test/html/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'
coverage: '/Jacoco Coverage Total: ([0-9]{1,3})%/'
artifacts:
when: always
reports:
junit: build/test-results/test/**/TEST-*.xml
paths:
- build/reports/jacoco/test/jacocoTestReport.xml
coverage:
stage: visualize
tags:
- exec-docker
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
script:
# convert report from jacoco to cobertura
- 'python /opt/cover2cover.py build/reports/jacoco/test/jacocoTestReport.xml src/main/java > build/cobertura.xml'
# read the <source></source> tag and prepend the path to every filename attribute
- 'python /opt/source2filename.py build/cobertura.xml'
needs: ["test"]
dependencies:
- test
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/cobertura.xml
push-dockerhub-native:
image: ghcr.io/graalvm/graalvm-ce:ol7-java11-22.3.0
stage: deploy
only:
- master
before_script:
- gu install native-image
tags:
- exec-docker
script:
- ./gradlew clean assemble -Dquarkus.package.type=native -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true -Dquarkus.container-image.name=collaboration-service-native -Dquarkus.container-image.additional-tags=$CI_COMMIT_SHORT_SHA -Dquarkus.native.additional-build-args="--initialize-at-run-time=org.apache.kafka.common.security.authenticator.SaslClientAuthenticator\\,org.apache.kafka.common.security.oauthbearer.internals.expiring.ExpiringCredentialRefreshingLogin" -Dquarkus.container-image.username=$EXPLORVIZ_DOCKERHUB_USERNAME -Dquarkus.container-image.password=$EXPLORVIZ_DOCKERHUB_PASSWORD
push-dockerhub:
stage: deploy
only:
- master
except:
- schedules
tags:
- exec-docker
script:
- ./gradlew clean assemble -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true -Dquarkus.container-image.additional-tags=$CI_COMMIT_SHORT_SHA -Dquarkus.container-image.username=$EXPLORVIZ_DOCKERHUB_USERNAME -Dquarkus.container-image.password=$EXPLORVIZ_DOCKERHUB_PASSWORD