-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
169 lines (155 loc) · 3.39 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
stages:
- build-docker-image
- checkstyle
- static-code-analysis
- test
- build
- build-rpm
- deploy
variables:
PROJECT_NAME_DIR: "zkPolicy"
MAVEN_OPTS: -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2
cache:
paths:
- .m2/
default:
before_script:
- cd $PROJECT_NAME_DIR
build-docker:
stage: build-docker-image
when: manual
only:
refs:
- ITHADOOP_767 # TODO: remove after testing
- testing
- qa
- devops/koji-build
script:
- echo 'Build docker image...'
- echo ${STAGE}
variables:
DOCKER_FILE: docker/DockerfileMVNBuilder
TO: $CI_REGISTRY_IMAGE:mvn-builder
tags:
- docker-image-build
checkstyle:
stage: checkstyle
image: ${CI_REGISTRY_IMAGE}:mvn-builder
script:
- mvn clean checkstyle:checkstyle checkstyle:check
artifacts:
paths:
- ${PROJECT_NAME_DIR}/target/checkstyle*
- ${PROJECT_NAME_DIR}/target/site/checkstyle*
expire_in: 1 week
tags:
- docker
pmd:
stage: static-code-analysis
image: ${CI_REGISTRY_IMAGE}:mvn-builder
script:
- mvn clean pmd:pmd pmd:check
artifacts:
paths:
- ${PROJECT_NAME_DIR}/target/pmd*
- ${PROJECT_NAME_DIR}/target/site/pmd*
expire_in: 1 week
tags:
- docker
cpd:
stage: static-code-analysis
image: ${CI_REGISTRY_IMAGE}:mvn-builder
script:
- mvn clean pmd:cpd pmd:cpd-check
artifacts:
paths:
- ${PROJECT_NAME_DIR}/target/cpd*
- ${PROJECT_NAME_DIR}/target/site/cpd*
expire_in: 1 week
tags:
- docker
spotbugs:
stage: static-code-analysis
image: ${CI_REGISTRY_IMAGE}:mvn-builder
script:
- mvn clean compile spotbugs:check -Dpmd.skip=true -Dcpd.skip=true -Dcheckstyle.skip=true
artifacts:
paths:
- ${PROJECT_NAME_DIR}/target/spotbugs*
expire_in: 1 week
tags:
- docker
test:
stage: test
image: ${CI_REGISTRY_IMAGE}:mvn-builder
script:
- mvn --quiet test -Dpmd.skip=true -Dcpd.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true
artifacts:
paths:
- ${PROJECT_NAME_DIR}/target/surefire-reports
- ${PROJECT_NAME_DIR}/target/zkpolicy_test.log
expire_in: 1 week
tags:
- docker
build:
stage: build
image: ${CI_REGISTRY_IMAGE}:mvn-builder
except:
- qa
script:
- mvn --quiet package -DskipTests -Dpmd.skip=true -Dcpd.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true
tags:
- docker
artifacts:
paths:
- ${PROJECT_NAME_DIR}/target/zkpolicy_autocomplete
- ${PROJECT_NAME_DIR}/target/*.jar
- ${PROJECT_NAME_DIR}/target/generated-picocli-docs
- ${PROJECT_NAME_DIR}/target/generated-docs
expire_in: 8 hour
.koji_deps_template: &koji_deps
before_script:
- echo $KRB_PWD_RPM | kinit ${KRB_USER_RPM}@CERN.CH
build-rpm-testing:
<<: *koji_deps
stage: build-rpm
image: ${CI_REGISTRY_IMAGE}:mvn-builder
when: manual
except:
- qa
- master
script:
- make add-testing
- make kbuild
dependencies:
- build
tags:
- docker
tag-qa:
<<: *koji_deps
stage: deploy
image: ${CI_REGISTRY_IMAGE}:mvn-builder
when: manual
only:
- qa
script:
- make add-qa
- make tag-qa
allow_failure: false
dependencies: []
tags:
- docker
tag-stable:
<<: *koji_deps
stage: deploy
image: ${CI_REGISTRY_IMAGE}:mvn-builder
when: manual
only:
- master
script:
- make add-stable
- make tag-stable
allow_failure: false
dependencies: []
tags:
- docker