-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
35 lines (29 loc) · 932 Bytes
/
.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
image: gradle:8.3-jdk11
variables:
# Set the location of the dependency cache to a local directory, so that it
# can be cached between GitLab Continous Integration Jobs.
GRADLE_USER_HOME: '.gradle'
GRADLE: 'gradle'
SONAR: 'https://sonarqube.ow2.org'
cache:
paths:
# Cache the downloaded dependencies and plugins between builds.
- '$GRADLE_USER_HOME'
build-job:
stage: build
script:
- $GRADLE build
test-job:
stage: test
script:
- $GRADLE test jacocoTestCoverageVerification
deploy-job:
stage: deploy
script:
- if [ $NEXUS_USER_NAME ]; then $GRADLE publish; fi
- if [ !$NEXUS_USER_NAME ]; then $GRADLE publishToMavenLocal; fi
sonar-job:
stage: deploy
allow_failure: true
script:
- if [ $SONAR_LOGIN ]; then $GRADLE -Dorg.gradle.jvmargs='-XX:MetaspaceSize=1024M -XX:MaxMetaspaceSize=1024M' jacocoTestReport sonar -Dsonar.host.url=$SONAR -Dsonar.login=${SONAR_LOGIN}; fi