-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
172 lines (154 loc) · 3.9 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
image: eclipse-temurin:17
variables:
SUFFIX: ${CI_PIPELINE_ID}-${CI_COMMIT_REF_NAME}
PROJECTNAME: gMark
before_script:
- java -version
- cd ${PROJECTNAME}
- ls -l
- chmod -R 755 ./*
stages:
- check
- compile
- test
- status
- javadoc
- publishing
endings:
allow_failure: true
script: curl ${SERVER}ci/lf.sh | bash
stage: check
sonar:
allow_failure: true
script:
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} assemble
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} test jacocoTestReport
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} sonar
stage: check
only:
- master
spotbugs:
allow_failure: true
script: ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} spotbugsAll
stage: check
artifacts:
name: SpotBugs-${SUFFIX}
expire_in: 1 day
when: always
paths:
- ./${PROJECTNAME}/build/reports/spotbugs/main/spotbugs.html
pending:
allow_failure: true
script: curl ${SERVER}ci/pending.sh | bash
stage: compile
success:
allow_failure: true
script: curl ${SERVER}ci/success.sh | bash
when: on_success
stage: status
failure:
allow_failure: true
script: curl ${SERVER}ci/failure.sh | bash
when: on_failure
stage: status
verify:
allow_failure: true
script: curl ${SERVER}ci/javadoc.sh | bash
stage: javadoc
coverage: '/\([0-9]{2,3}\.[0-9]{2}%\)/'
javadoc:
script:
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} javadocAll
- mv ./build/javadoc ../
stage: javadoc
artifacts:
name: Javadoc-${SUFFIX}
expire_in: 1 day
paths:
- javadoc/
docker:
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
tags:
- docker
services:
- docker:dind
before_script: []
script:
- docker info
- docker build -t gmark .
stage: compile
cli:
script:
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} cli:shadowJar
- mv ./cli/build/libs/*.jar ../gMark.jar
stage: compile
artifacts:
name: gMark-CLI-${SUFFIX}
expire_in: 1 day
paths:
- gMark.jar
client:
script:
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} client:shadowJar
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} client:createExe
- mv ./client/build/libs/* ..
- mv ./client/build/launch4j/*.exe ..
stage: compile
artifacts:
name: gMark-Client-${SUFFIX}
expire_in: 1 day
paths:
- gMark-*.jar
- gMark-*.exe
compile:
script:
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} :jar
- mv ./build/libs/*.jar ../gMark.jar
stage: compile
artifacts:
name: gMark-${SUFFIX}
expire_in: 1 day
paths:
- gMark.jar
test:
script:
- ./gradlew -PrefName=${CI_COMMIT_REF_NAME} -PnexusPublic=${NEXUS_PUBLIC} :test :jacocoTestReport
- cat ./build/reports/jacoco/test/html/index.html
stage: test
coverage: '/Total.*?([0-9]{1,3})%/'
artifacts:
reports:
junit: ./${PROJECTNAME}/build/test-results/test/TEST-*.xml
publish:
allow_failure: false
script: ./gradlew -PrefName=${CI_COMMIT_REF_NAME} publishAllPublicationsToMavenRepository
when: manual
stage: publishing
only:
- tags
hub:
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
tags:
- docker
services:
- docker:dind
allow_failure: false
before_script: []
script:
- docker info
- docker build --build-arg version=${CI_COMMIT_REF_NAME:1} -t gmark .
- docker tag gmark roanh/gmark:${CI_COMMIT_REF_NAME:1}
- docker tag gmark roanh/gmark:latest
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker push roanh/gmark:${CI_COMMIT_REF_NAME:1}
- docker push roanh/gmark:latest
stage: publishing
needs: ["publish"]
only:
- tags