forked from overviewer/Minecraft-Overviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
502 lines (466 loc) · 14.3 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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
stages:
- build
- test
- package
- verify
- deploy
- testrepo
variables:
EXMAPLE_REPO: "https://github.com/overviewer/Minecraft-Overviewer-Addons"
MC_VERSION: "1.12"
build:linux:
image: registry.code.em32.net/overviewer/minecraft-overviewer:base
stage: build
dependencies: []
tags:
- docker
cache:
key: "$CI_BUILD_REF_NAME-$CI_PIPELINE_ID-linuxbuild"
paths:
- overviewer_core/c_overviewer.so
- overviewer_core/overviewer_version.py
- overviewer_core/src/primitives.h
- build/
script:
- python2 setup.py build
- python2 overviewer.py --verbose --version
build:windows:
stage: build
dependencies: []
tags:
- windows
script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PIL_INCLUDE_DIR=c:\devel\pillow\src\libImaging
- c:\Python27\python.exe c:\devel\virtualenv\virtualenv.py ci_env
- ci_env\scripts\pip.exe install numpy Pillow==5.1.0
- ci_env\Scripts\python.exe setup.py build
- ci_env\Scripts\python.exe overviewer.py --verbose --version
build:docs:
image: registry.code.em32.net/overviewer/minecraft-overviewer:base
stage: build
dependencies: []
tags:
- docker
script:
- cd docs
- make
artifacts:
name: "overviewer-docs"
expire_in: 2 weeks
paths:
- docs/_build/html/
test:
image: registry.code.em32.net/overviewer/minecraft-overviewer:base
stage: test
dependencies: []
tags:
- docker
cache:
key: "$CI_BUILD_REF_NAME-$CI_PIPELINE_ID-linuxbuild"
paths:
- overviewer_core/c_overviewer.so
- overviewer_core/overviewer_version.py
- overviewer_core/src/primitives.h
- build/
script:
- python2 setup.py build
- python2 test/test_all.py
render:
image: registry.code.em32.net/overviewer/minecraft-overviewer:base
stage: test
dependencies: []
tags:
- docker
cache:
key: "$CI_BUILD_REF_NAME-$CI_PIPELINE_ID-linuxbuild"
paths:
- overviewer_core/c_overviewer.so
- overviewer_core/overviewer_version.py
- overviewer_core/src/primitives.h
- build/
script:
- python2 setup.py build
- wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MC_VERSION}/${MC_VERSION}.jar -P ~/.minecraft/versions/${MC_VERSION}/
- git clone --depth=1 ${EXMAPLE_REPO} maprepo
- export RENDER_DIR=render/
- mkdir -p $RENDER_DIR
- python2 overviewer.py -p2 --rendermode=smooth_lighting maprepo/exmaple $RENDER_DIR
- zip -r render.zip $RENDER_DIR
artifacts:
expire_in: 2 days
paths:
- render.zip
# Builds a source package
pkg:src:
image: registry.code.em32.net/overviewer/minecraft-overviewer:base
stage: package
dependencies: []
tags:
- docker
script:
- python2 setup.py sdist
- ls -lh dist
- mv dist/*.tar.gz .
artifacts:
expire_in: 2 weeks
paths:
- Minecraft-Overviewer*.tar.gz
pkg:centos7rpm:
image: registry.code.em32.net/overviewer/minecraft-overviewer:centos7
stage: package
dependencies: []
tags:
- docker
script:
- export MCO_VERSION=`python2 setup.py --version`
- echo "Building Minecraft version ${MCO_VERSION}"
- mkdir -p ${HOME}/rpmbuild/SOURCES
- tar --transform 's,^,Minecraft-Overviewer/,S' -czf ${HOME}/rpmbuild/SOURCES/Minecraft-Overviewer-${MCO_VERSION}.tar.gz *
- sed s/{VERSION}/$MCO_VERSION/g build-tools/dockerfiles/centos7/Minecraft-Overviewer.spec > Minecraft-Overviewer.spec
- pwd
- rpmbuild -bs --define 'dist .centos7' Minecraft-Overviewer.spec
- /usr/bin/mock -r centos-7-x86_64 ${HOME}/rpmbuild/SRPMS/Minecraft-Overviewer-${MCO_VERSION}-1.centos7.src.rpm
- cp /var/lib/mock/centos-7-x86_64/result/Minecraft-Overviewer*.x86_64.rpm .
- ls -l *.rpm
artifacts:
expire_in: 2 weeks
paths:
- Minecraft-Overviewer*.x86_64.rpm
pkg:centos7-32rpm:
image: registry.code.em32.net/overviewer/minecraft-overviewer:centos7
stage: package
dependencies: []
tags:
- docker
only:
- master
- triggers
script:
- export MCO_VERSION=`python2 setup.py --version`
- echo "Building Minecraft version ${MCO_VERSION}"
- mkdir -p ${HOME}/rpmbuild/SOURCES
- tar --transform 's,^,Minecraft-Overviewer/,S' -czf ${HOME}/rpmbuild/SOURCES/Minecraft-Overviewer-${MCO_VERSION}.tar.gz *
- sed s/{VERSION}/$MCO_VERSION/g build-tools/dockerfiles/centos7/Minecraft-Overviewer.spec > Minecraft-Overviewer.spec
- pwd
- rpmbuild -bs --define 'dist .centos7' Minecraft-Overviewer.spec
- /usr/bin/mock -r centos-7-i386 ${HOME}/rpmbuild/SRPMS/Minecraft-Overviewer-${MCO_VERSION}-1.centos7.src.rpm
- cp /var/lib/mock/centos-7-i386/result/Minecraft-Overviewer*.i*86.rpm .
- ls -l *.rpm
artifacts:
expire_in: 2 weeks
paths:
- Minecraft-Overviewer*.i*86.rpm
# Note that even though we are building a centos6 rpm, we can still use the centos7 docker image
pkg:centos6rpm:
image: registry.code.em32.net/overviewer/minecraft-overviewer:centos7
stage: package
dependencies: []
tags:
- docker
only:
- master
- triggers
script:
- export MCO_VERSION=`python2 setup.py --version`
- echo "Building Minecraft version ${MCO_VERSION}"
- mkdir -p ${HOME}/rpmbuild/SOURCES
- tar --transform 's,^,Minecraft-Overviewer/,S' -czf ${HOME}/rpmbuild/SOURCES/Minecraft-Overviewer-${MCO_VERSION}.tar.gz *
- sed s/{VERSION}/$MCO_VERSION/g build-tools/dockerfiles/centos6/Minecraft-Overviewer.spec > Minecraft-Overviewer.spec
- pwd
- rpmbuild -bs --define 'dist .centos6' Minecraft-Overviewer.spec
- /usr/bin/mock -r centos-6-x86_64 ${HOME}/rpmbuild/SRPMS/Minecraft-Overviewer-${MCO_VERSION}-1.centos6.src.rpm
- cp /var/lib/mock/centos-6-x86_64/result/Minecraft-Overviewer*.x86_64.rpm .
- ls -l *.rpm
artifacts:
expire_in: 2 weeks
paths:
- Minecraft-Overviewer*.x86_64.rpm
pkg:debian64:
image: registry.code.em32.net/overviewer/minecraft-overviewer:debian64
stage: package
dependencies: []
tags:
- docker
script:
- export MCO_VERSION=`python2 setup.py --version`
- echo "Building Minecraft version ${MCO_VERSION}"
- python setup.py build
- cp -r build-tools/dockerfiles/debian64 debian
- sh debian/generate_changelog.sh > debian/changelog
- cat debian/changelog
- debuild -i -us -uc -b
- mv ../*.deb .
- ls -l *.deb
artifacts:
expire_in: 2 weeks
paths:
- minecraft-overviewer*.deb
pkg:win64:
stage: package
dependencies: []
tags:
- windows
script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PIL_INCLUDE_DIR=c:\devel\pillow\src\libImaging
- c:\Python27\python.exe c:\devel\virtualenv\virtualenv.py ci_env
- ci_env\scripts\pip.exe install numpy Pillow==5.1.0 pyinstaller sphinx
- ci_env\Scripts\python.exe setup.py build
- copy build-tools\overviewer.spec .
- ci_env\Scripts\pyinstaller.exe overviewer.spec
- for /f "delims=" %%a in ('ci_env\Scripts\python.exe setup.py --version') do @set OVR_VERSION=%%a
- ci_env\Scripts\sphinx-build.exe docs dist\overviewer-%OVR_VERSION%\docs
- rename dist dist-win64
- ci_env\Scripts\python.exe -m zipfile -c overviewer-win64-%OVR_VERSION%.zip dist-win64\overviewer-%OVR_VERSION%\
artifacts:
expire_in: 2 weeks
paths:
- overviewer-win64-*.zip
pkg:win32:
stage: package
dependencies: []
tags:
- windows
script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
- set DISTUTILS_USE_SDK=1
- set MSSdk=1
- set PIL_INCLUDE_DIR=c:\devel\pillow\src\libImaging
- "\"c:\\Python27 (x86)\\python.exe\" c:\\devel\\virtualenv\\virtualenv.py ci_env"
- ci_env\scripts\pip.exe install numpy Pillow==5.1.0 pyinstaller sphinx
- ci_env\Scripts\python.exe setup.py build
- copy build-tools\overviewer.spec .
- ci_env\Scripts\pyinstaller.exe overviewer.spec
- for /f "delims=" %%a in ('ci_env\Scripts\python.exe setup.py --version') do @set OVR_VERSION=%%a
- ci_env\Scripts\sphinx-build.exe docs dist\overviewer-%OVR_VERSION%\docs
- rename dist dist-win32
- ci_env\Scripts\python.exe -m zipfile -c overviewer-win32-%OVR_VERSION%.zip dist-win32\overviewer-%OVR_VERSION%\
artifacts:
expire_in: 2 weeks
paths:
- overviewer-win32-*.zip
verify:centos7:
image: registry.code.em32.net/overviewer/minecraft-overviewer:centos7-verify
stage: verify
tags:
- docker
dependencies:
- pkg:centos7rpm
script:
- ls -l *.rpm
- ls -l
- echo yum -y install ./Minecraft-Overviewer-0*.rpm
- yum -y install ./Minecraft-Overviewer-0*.rpm
- which overviewer.py
- overviewer.py --verbose --version
- wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MC_VERSION}/${MC_VERSION}.jar -P ~/.minecraft/versions/${MC_VERSION}/
- git clone --depth=1 ${EXMAPLE_REPO} maprepo
- overviewer.py --check-terrain --verbose
verify:debian64:
image: debian:jessie
stage: verify
tags:
- docker
dependencies:
- pkg:debian64
script:
- apt-get -y update
- apt-get -y install wget git
- dpkg -i ./minecraft-overviewer*.deb || echo ""
- apt-get -y -f install
- which overviewer.py
- overviewer.py --verbose --version
- wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MC_VERSION}/${MC_VERSION}.jar -P ~/.minecraft/versions/${MC_VERSION}/
- git clone --depth=1 ${EXMAPLE_REPO} maprepo
- overviewer.py --check-terrain --verbose
deploy:
stage: deploy
tags:
- diax
- deploy
variables:
GIT_STRATEGY: none
dependencies:
- render
script:
- rm -rf render
- unzip render.zip
- mkdir -p /renders/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
- cp -r render/* /renders/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
- echo View render at http://static-backend.overviewer.org/renders/ci/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
deploy:builds:
stage: deploy
tags:
- diax
- deploy
dependencies:
- build:docs
- pkg:src
- pkg:centos7rpm
- pkg:centos7-32rpm
- pkg:centos6rpm
- pkg:debian64
- pkg:win64
- pkg:win32
script:
- ls -ltr
- mkdir -p /builds/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
- cp *.deb /builds/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
- cp *.rpm /builds/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
- cp overviewer*.zip /builds/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
- echo Artifacts copied to http://static-backend.overviewer.org/builds/$CI_BUILD_REF_SLUG/$CI_BUILD_ID/
deploy:repos:
stage: deploy
tags:
- diax
- deploy
only:
- master
dependencies:
- pkg:centos7rpm
- pkg:centos7-32rpm
- pkg:centos6rpm
- pkg:debian64
script:
- ls -ltr
- dpkg-sig -g '--use-agent --batch --no-tty' --sign builder *.deb
- cp *.deb /repos/debian/files/
- make -C /repos/debian/ -f /gitlab_runner/debian/Makefile
- /gitlab_runner/rpmsign.sh *.rpm
- cp *.el7.*.rpm /repos/rpm/7/x86_64/packages/
- cp *.el6.*.rpm /repos/rpm/6/x86_64/packages/
- make -C /repos/rpm/ -f /gitlab_runner/rpm/Makefile
repo:centos7:
image: centos:7
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- yum -y install wget
- wget -O /etc/yum.repos.d/overviewer.repo http://overviewer.org/rpms_new/overviewer.repo
- yum -y install Minecraft-Overviewer
- overviewer.py --verbose --version
repo:centos6:
image: centos:6
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- yum -y install wget
- wget -O /etc/yum.repos.d/overviewer.repo http://overviewer.org/rpms_new/overviewer.repo
- yum -y install Minecraft-Overviewer
- overviewer.py --verbose --version
repo:fc25:
image: fedora:25
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- yum -y install wget
- wget -O /etc/yum.repos.d/overviewer.repo http://overviewer.org/rpms_new/overviewer.repo
- yum -y install Minecraft-Overviewer
- overviewer.py --verbose --version
repo:fc24:
image: fedora:24
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- yum -y install wget
- wget -O /etc/yum.repos.d/overviewer.repo http://overviewer.org/rpms_new/overviewer.repo
- yum -y install Minecraft-Overviewer
- overviewer.py --verbose --version
repo:fc23:
image: fedora:23
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- yum -y install wget
- wget -O /etc/yum.repos.d/overviewer.repo http://overviewer.org/rpms_new/overviewer.repo
- yum -y install Minecraft-Overviewer
- overviewer.py --verbose --version
repo:jessie:
image: debian:jessie
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- apt-get -y update
- apt-get -y install wget
- wget -O - http://overviewer.org/debian_new/overviewer.gpg.asc | apt-key add -
- echo 'deb http://overviewer.org/debian_new ./' >> /etc/apt/sources.list
- apt-get -y update
- apt-get -y install minecraft-overviewer
- overviewer.py --verbose --version
repo:stretch:
image: debian:stretch
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- apt-get -y update
- apt-get -y install wget gnupg
- wget -O - http://overviewer.org/debian_new/overviewer.gpg.asc | apt-key add -
- echo 'deb http://overviewer.org/debian_new ./' >> /etc/apt/sources.list
- apt-get -y update
- apt-get -y install minecraft-overviewer
- overviewer.py --verbose --version
repo:wheezy:
image: debian:wheezy
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- apt-get -y update
- apt-get -y install wget
- wget -O - http://overviewer.org/debian_new/overviewer.gpg.asc | apt-key add -
- echo 'deb http://overviewer.org/debian_new ./' >> /etc/apt/sources.list
- apt-get -y update
- apt-get -y install minecraft-overviewer
- overviewer.py --verbose --version
repo:artful:
image: ubuntu:artful
stage: testrepo
dependencies: []
tags:
- docker
only:
- master
script:
- apt-get -y update
- apt-get -y install wget
- wget -O - http://overviewer.org/debian_new/overviewer.gpg.asc | apt-key add -
- echo 'deb http://overviewer.org/debian_new ./' >> /etc/apt/sources.list
- apt-get -y update
- apt-get -y install minecraft-overviewer
- overviewer.py --verbose --version