-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
86 lines (78 loc) · 2.31 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
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer=warn --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings /opt/maven/settings.xml --global-toolchains /opt/maven/toolchain.xml"
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: $CI_JOB_NAME
paths:
- .m2/repository
stages:
- prepare
- build
- qa
- deploy
# This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
# Because some enforcer rules might check dependency convergence and class duplications
# we use `test-compile` here instead of `validate`, so the correct classpath is picked up.
validate:
tags:
- java-multi
- maven
stage: prepare
retry: 2
script:
- 'mvn $MAVEN_CLI_OPTS test-compile'
compile:
tags:
- java-multi
- maven
stage: build
script:
- 'mvn $MAVEN_CLI_OPTS compile'
release:
tags:
- java-multi
- maven
stage: deploy
only:
- release
script:
- 'mvn $MAVEN_CLI_OPTS deploy'
verify:
tags:
- java-multi
- maven
stage: qa
script:
- 'mvn $MAVEN_CLI_OPTS verify'
- "awk -F, '{ instructions += $4 + $5; covered += $5 } END { print covered, \"/\", instructions, \" instructions covered\"; print 100*covered/instructions, \"% covered\" }' target/site/jacoco/jacoco.csv"
retry: 2
coverage: '/\d+\.\d+\s*\%\s+covered/'
artifacts:
reports:
junit:
- 'target/surefire-reports/*.xml'
- 'target/failsafe-reports/*.xml'
deploy:
tags:
- java-multi
- maven
stage: deploy
script:
- 'mvn $MAVEN_CLI_OPTS deploy'
retry: 2
only:
- release
artifacts:
reports:
junit:
- '*/target/surefire-reports/*.xml'
- '*/target/failsafe-reports/*.xml'
renew_tester_token:
tags:
- java-multi
stage: prepare
script:
- "curl --request POST --url https://vault.provingground.tech/v1/auth/token/renew-self --header 'Content-Type: application/json' --header 'X-Vault-Token: 400efe39-fbbd-a8c4-c422-f7c2d5b20974' --header 'cache-control: no-cache' -vs > /dev/null"
only:
- master