-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
78 lines (63 loc) · 1.61 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
image: maven:3.6-jdk-11
stages:
- build
- test
- deploy
cache:
paths:
- .m2/repository
key: "$CI_BUILD_REF_NAME"
variables:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.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 --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
compile-job:
stage: build
script:
- 'mvn clean compile $MAVEN_CLI_OPTS'
retry:
max: 2
when: runner_system_failure
unittest-job:
stage: test
script:
- 'mvn test $MAVEN_CLI_OPTS'
- 'cat target/site/jacoco/index.html'
dependencies:
- compile-job
artifacts:
reports:
junit:
- target/surefire-reports/TEST-*.xml
paths:
- target/surefire-reports
- target/site/jacoco
when: always
retry:
max: 2
when: runner_system_failure
allow_failure: true
pages:
stage: deploy
script:
- 'mvn -Dmaven.test.skip=true surefire-report:report "-DoutputName=report"'
# - 'mvn -Dmaven.test.skip=true surefire-report:report "-DoutputName=$CI_COMMIT_SHORT_SHA"'
- 'mv target/site/jacoco public'
dependencies:
- unittest-job
artifacts:
paths:
- target/surefire-reports
- public
createjar-job:
stage: deploy
script:
- 'mvn clean compile assembly:single $MAVEN_CLI_OPTS'
dependencies:
- unittest-job
artifacts:
paths:
- release/*.jar
when: always
retry:
max: 2
when: runner_system_failure