forked from nordugrid/arc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
311 lines (291 loc) · 8.87 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
## Please do not change this file.
## Doing so will unfortunately create unnesseccary merge conflicts between branches and the fork, and nordugrid/arc version of this file.
## To have the automatic builds work on your fork, check that the runner is enabled in your fork: Settings->CI/CD->Runner settings
stages:
- static_ana
- build
- packages
- deploy_and_test
fork_packages_el6:
stage: build
image: maikenp/arc-build-centos6
script:
- echo "$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}_master" > VERSION
- yum update -y
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- echo "Preparing and running rpmbuild"
- mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
- rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
tags:
- build
except:
refs:
- master
- next-major
- dev-ARC6
- branches@nordugrid/arc
- tags@nordugrid/arc
artifacts:
when: on_success
expire_in: 3 days
paths:
- $CI_PROJECT_DIR/rpmbuild/SRPMS/
- $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
- $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
allow_failure: false
fork_packages_el7:
stage: build
image: maikenp/arc-build-centos7
script:
- echo "$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}_master" > VERSION
- yum update -y
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- echo "Preparing and running rpmbuild"
- mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
- rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
artifacts:
when: on_success
expire_in: 3 days
paths:
- $CI_PROJECT_DIR/rpmbuild/SRPMS/
- $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
- $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
allow_failure: false
tags:
- build
except:
refs:
- master
- next
- branches@nordugrid/arc
- tags@nordugrid/arc
allow_failure: false
fork_packages_deb9:
stage: build
image: maikenp/arc-build-debian9
script:
- apt-get update -y
- echo "6.0.0" > VERSION
- ./autogen.sh
- ./configure
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz nordugrid-arc_${VERSION}.orig.tar.gz
- tar -z -x -f nordugrid-arc_${VERSION}.orig.tar.gz
- cd nordugrid-arc-${VERSION}
- dpkg-buildpackage -S -us -uc -d
- apt-get build-dep ../nordugrid-arc_${VERSION}-1.dsc -y
- dpkg-buildpackage -b -us -uc
- echo Delete dbgsym debs to save space
- rm -f ../*-dbgsym_*.deb
tags:
- build
except:
refs:
- master
- next
- branches@nordugrid/arc
- tags@nordugrid/arc
artifacts:
when: on_success
expire_in: 3 days
paths:
- $CI_PROJECT_DIR/*.orig.tar.gz
- $CI_PROJECT_DIR/*.debian.tar.*
- $CI_PROJECT_DIR/*.dsc
- $CI_PROJECT_DIR/*.deb
allow_failure: false
packages_deb9:
stage: packages
image: maikenp/arc-build-debian9
script:
- echo "6.0.0" > VERSION
- apt-get update -y
- ./autogen.sh
- ./configure
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz nordugrid-arc_${VERSION}.orig.tar.gz
- tar -z -x -f nordugrid-arc_${VERSION}.orig.tar.gz
- cd nordugrid-arc-${VERSION}
- dpkg-buildpackage -S -us -uc -d
- apt-get build-dep ../nordugrid-arc_${VERSION}-1.dsc -y
- dpkg-buildpackage -b -us -uc
- echo Delete dbgsym debs to save space
- rm -f ../*-dbgsym_*.deb
tags:
- build
only:
- branches@nordugrid/arc
- tags@nordugrid/arc
artifacts:
when: on_success
expire_in: 30 days
paths:
- $CI_PROJECT_DIR/*.orig.tar.gz
- $CI_PROJECT_DIR/*.debian.tar.*
- $CI_PROJECT_DIR/*.dsc
- $CI_PROJECT_DIR/*.deb
allow_failure: true
packages_el6:
stage: packages
image: maikenp/arc-build-centos6
script:
- echo "$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}_master" > VERSION
- yum update -y
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- echo "Preparing and running rpmbuild"
- mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
- rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
tags:
- build
only:
- branches@nordugrid/arc
- tags@nordugrid/arc
artifacts:
when: on_success
expire_in: 30 days
paths:
- $CI_PROJECT_DIR/rpmbuild/SRPMS/
- $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
- $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
allow_failure: false
packages_el7:
stage: packages
image: maikenp/arc-build-centos7
script:
- echo "$(date +%Y%m%dT%H%M%S)_${CI_COMMIT_SHA:0:8}_master" > VERSION
- yum update -y
- ./autogen.sh
- ./configure
- yum-builddep nordugrid-arc.spec -y
- echo "Preparing and running rpmbuild"
- mkdir -p rpmbuild/{SOURCES,BUILD,RPMS,SRPMS}
- make dist
- VERSION=`cat VERSION`
- mv nordugrid-arc-${VERSION}.tar.gz rpmbuild/SOURCES
- rpmbuild -D "_topdir $CI_PROJECT_DIR/rpmbuild" -ba nordugrid-arc.spec
tags:
- build
only:
- branches@nordugrid/arc
- tags@nordugrid/arc
artifacts:
when: on_success
expire_in: 30 days
paths:
- $CI_PROJECT_DIR/rpmbuild/SRPMS/
- $CI_PROJECT_DIR/rpmbuild/RPMS/noarch/
- $CI_PROJECT_DIR/rpmbuild/RPMS/x86_64/
allow_failure: false
run_static_analysis_el6:
stage: static_ana
image: maikenp/arc-sca-centos6
script:
- set +e
- echo "Enabling python27 for running the cppcheck-htmlreport"
#- export PYTHONPATH="/opt/rh/python27/root/usr/lib/python2.7/site-packages/":$PYTHONPATH
#- export PATH="/opt/rh/python27/root/usr/bin/":$PATH
#- export LD_LIBRARY_PATH="/opt/rh/python27/root/usr/lib64/":$LD_LIBRARY_PATH
#- python --version
- mkdir $CI_PROJECT_DIR/arc-tests
- mkdir $CI_PROJECT_DIR/arc-tests/sloccount
- mkdir $CI_PROJECT_DIR/arc-tests/cppcheck_html
- mkdir $CI_PROJECT_DIR/arc-tests/rats
- mkdir $CI_PROJECT_DIR/arc-tests/flawfinder
- mkdir $CI_PROJECT_DIR/arc-tests/cpplint
- ls
- ls /
- echo "Enabling python27 for running the cppcheck-htmlreport"
- export PYTHONPATH="/opt/rh/python27/root/usr/lib/python2.7/site-packages/":$PYTHONPATH
- export PATH="/opt/rh/python27/root/usr/bin/":$PATH
- export LD_LIBRARY_PATH="/opt/rh/python27/root/usr/lib64/":$LD_LIBRARY_PATH
- python --version
- rats --html -w 3 ./ > $CI_PROJECT_DIR/arc-tests/rats/rats.html 2>&1
- /flawfinder-1.31/flawfinder -m 2 --html --dataonly ./ > $CI_PROJECT_DIR/arc-tests/flawfinder/flawfinder.html 2>&1
- scl enable python27 'cpplint --recursive counting=detailed --output=junit ./ > $CI_PROJECT_DIR/arc-tests/cpplint/cpplint.xml 2>&1'
- cppcheck --enable=all --inconclusive --xml --xml-version=2 . 2> $CI_PROJECT_DIR/arc-tests/cppcheck.xml
- scl enable python27 '$CP_PROJECT_DIR/cppcheck/htmlreport/cppcheck-htmlreport --file=$CI_PROJECT_DIR/arc-tests/cppcheck.xml --report-dir=$CI_PROJECT_DIR/arc-tests/cppcheck_html --source-dir=.'
- ls $CI_PROJECT_DIR/arc-tests/
tags:
- 158.39.77.235
only:
- branches@nordugrid/arc
- tags@nordugrid/arc
artifacts:
when: always
expire_in: 1 days
paths:
- $CI_PROJECT_DIR/arc-tests/
allow_failure: false
deploy_staging_el6:
stage: deploy_and_test
image: docker:stable
script:
- cat /dockerrun.sh
- ls -lhrt /arc-testfiles
- ls -lhrt /arc-logs
- source /dockerrun.sh
- echo "*************>> Done - back from inner container"
- ls -lhrt /arc-logs
- cp -r /arc-logs $CI_PROJECT_DIR
- ls -lhrt $CI_PROJECT_DIR/arc-logs
environment:
name: staging
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/arc-logs/
#- $CI_PROJECT_DIR/arc-tests/
dependencies:
- packages_el6
tags:
- docker-socket-runner-bgo4
only:
- branches@nordugrid/arc
- tags@nordugrid/arc
allow_failure: true
deploy_staging_el7:
stage: deploy_and_test
image: docker:stable
script:
- cat /dockerrun.sh
- ls -lhrt /arc-testfiles
- ls -lhrt /arc-logs
- source /dockerrun.sh
- echo "*************>> Done - back from inner container"
- ls -lhrt /arc-logs
- cp -r /arc-logs $CI_PROJECT_DIR
- ls -lhrt $CI_PROJECT_DIR/arc-logs
environment:
name: staging
artifacts:
when: always
paths:
- $CI_PROJECT_DIR/arc-logs/
#- $CI_PROJECT_DIR/arc-tests/
dependencies:
- packages_el7
tags:
- docker-socket-runner1
only:
- branches@nordugrid/arc
- tags@nordugrid/arc
allow_failure: true
## note-to-self: can also download the rpms from latest job with (example for el7):
## wget 'https://source.coderefinery.org/nordugrid/arc/-/jobs/artifacts/master/download?job=packages_el7' -O artifacts.zip