Permalink
Browse files

Enable gitlab CI

Even though the overviewer repo is hosted on github, this new CI stuff
is useful for mirrors of overviewer hosted on gitlab.

To support package builds for a few distributions, a set of dockerfiles
have been created.
  • Loading branch information...
1 parent 6ea2758 commit b81661dc9461ee89f856ac52d122285c92f8f1e3 @eminence eminence committed Dec 9, 2016
Showing with 466 additions and 0 deletions.
  1. +184 −0 .gitlab-ci.yml
  2. +2 −0 build-tools/dockerfiles/base/Dockerfile
  3. +9 −0 build-tools/dockerfiles/base/Makefile
  4. +3 −0 build-tools/dockerfiles/base/README
  5. +39 −0 build-tools/dockerfiles/centos5/Minecraft-Overviewer.spec
  6. +5 −0 build-tools/dockerfiles/centos6/Dockerfile
  7. +11 −0 build-tools/dockerfiles/centos6/Makefile
  8. +37 −0 build-tools/dockerfiles/centos6/Minecraft-Overviewer.spec
  9. +5 −0 build-tools/dockerfiles/centos7/Dockerfile
  10. +11 −0 build-tools/dockerfiles/centos7/Makefile
  11. +37 −0 build-tools/dockerfiles/centos7/Minecraft-Overviewer.spec
  12. +2 −0 build-tools/dockerfiles/debian64/Dockerfile
  13. +11 −0 build-tools/dockerfiles/debian64/Makefile
  14. +5 −0 build-tools/dockerfiles/debian64/changelog
  15. +1 −0 build-tools/dockerfiles/debian64/compat
  16. +13 −0 build-tools/dockerfiles/debian64/control
  17. +35 −0 build-tools/dockerfiles/debian64/copyright
  18. +8 −0 build-tools/dockerfiles/debian64/generate_changelog.sh
  19. +9 −0 build-tools/dockerfiles/debian64/rules
  20. +1 −0 build-tools/dockerfiles/debian64/source/format
  21. +1 −0 build-tools/dockerfiles/src/Dockerfile
  22. +5 −0 build-tools/dockerfiles/src/Makefile
  23. +2 −0 build-tools/dockerfiles/src/README
  24. +3 −0 build-tools/dockerfiles/verify-centos7/Dockerfile
  25. +11 −0 build-tools/dockerfiles/verify-centos7/Makefile
  26. +1 −0 build-tools/dockerfiles/verify-centos7/README
  27. +3 −0 build-tools/dockerfiles/verify-debian/Dockerfile
  28. +11 −0 build-tools/dockerfiles/verify-debian/Makefile
  29. +1 −0 build-tools/dockerfiles/verify-debian/README
View
@@ -0,0 +1,184 @@
+stages:
+ - build
+ - test
+ - package
+ - verify
+ - render
+
+variables:
+ EXMAPLE_REPO: "https://github.com/overviewer/Minecraft-Overviewer-Addons"
+ MC_VERSION: "1.11"
+
+build:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:base
+ stage: build
+ script:
+ - python2 setup.py build
+ - python2 overviewer.py --verbose --version
+
+build:docs:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:base
+ stage: build
+ script:
+ - cd docs
+ - make
+ artifacts:
+ name: "overviewer-docs"
+ expire_in: 2 weeks
+ paths:
+ - docs/_build/html/
+
+test:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:base
+ stage: test
+ dependencies:
+ - build
+ script:
+ - python2 setup.py build
+ - python2 test/test_all.py
+
+
+# Builds a source package
+package:src:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:base
+ stage: package
+ script:
+ - python2 setup.py sdist
+ - ls -lh dist
+ artifacts:
+ paths:
+ - dist/*.tar.gz
+
+package:centos7rpm:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7
+ stage: package
+ 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
+
+package:centos7-32rpm:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7
+ stage: package
+ 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
+package:centos6rpm:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7
+ stage: package
+ 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
+
+package:debian64:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:debian64
+ stage: package
+ 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
+
+
+verify:centos7:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:centos7-verify
+ stage: verify
+ dependencies:
+ - package: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: code.em32.net:14567/overviewer/minecraft-overviewer:debian-verify
+ stage: verify
+ dependencies:
+ - package:debian64
+ script:
+ - 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
+
+
+render:
+ image: code.em32.net:14567/overviewer/minecraft-overviewer:debian64
+ stage: render
+ tags:
+ - diax
+ dependencies:
+ - package:debian64
+ environment:
+ name: review/$CI_BUILD_REF_NAME
+ url: http://static-backend.overviewer.org/renders/ci/$CI_BUILD_REF_NAME/$CI_BUILD_ID
+ script:
+ - dpkg -i ./minecraft-overviewer*.deb
+ - 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=/renders/$CI_BUILD_REF_NAME/$CI_BUILD_ID
+ - mkdir -p $RENDER_DIR
+ - overviewer.py -p2 --rendermode=smooth_lighting maprepo/exmaple $RENDER_DIR
+ - "echo Map render now available at: http://static-backend.overviewer.org/renders/ci/$CI_BUILD_REF_NAME/$CI_BUILD_ID"
@@ -0,0 +1,2 @@
+FROM centos:7
+RUN yum -y install git wget python2 @'Development Tools' python-pillow-devel numpy python-sphinx
@@ -0,0 +1,9 @@
+build:
+ docker build -t code.em32.net:14567/overviewer/minecraft-overviewer:base .
+
+push:
+ docker push code.em32.net:14567/overviewer/minecraft-overviewer:base
+
+run:
+ docker run --rm -it code.em32.net:14567/overviewer/minecraft-overviewer:base /bin/bash
+
@@ -0,0 +1,3 @@
+This image is a centos:7 image that contains all the necessary tools to build
+and run Overviewer. It can serve as a base image for other images, or be used
+directly.
@@ -0,0 +1,39 @@
+%define python_sitearch %{_libdir}/python2.6/site-packages
+
+Summary: Generates large resolution images of a Minecraft map.
+Name: Minecraft-Overviewer
+Version: {VERSION}
+Release: 1%{?dist}
+Source0: %{name}-%{version}.tar.gz
+License: GNU General Public License v3
+Group: Development/Libraries
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+Vendor: Andrew Brown <brownan@gmail.com>
+Url: http://overviewer.org/
+Requires: python26, python26-imaging, python26-numpy
+BuildRequires: python26-devel, python26-imaging-devel, python26-numpy, python-setuptools
+
+%description
+The Minecraft Overviewer is a command-line tool for rendering high-resolution
+maps of Minecraft worlds. It generates a set of static html and image files and
+uses the Google Maps API to display a nice interactive map.
+
+%prep
+%setup -n %{name}
+
+%build
+env CFLAGS="$RPM_OPT_FLAGS" %{__python}26 setup.py build
+
+%install
+%{__python}26 setup.py install -O1 --root=%{buildroot}
+rm -rf %{buildroot}%{_defaultdocdir}/minecraft-overviewer
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%{python_sitearch}/Minecraft_Overviewer-*-*.egg-info
+%{python_sitearch}/overviewer_core
+%{_bindir}/overviewer.py
+%doc README.rst COPYING.txt sample_config.py
@@ -0,0 +1,5 @@
+FROM centos:6
+RUN yum -y install epel-release && yum -y install git wget python2 @'Development Tools' python-imaging-devel numpy python-sphinx mock
+RUN useradd --create-home --groups mock overviewer
+USER overviewer
+
@@ -0,0 +1,11 @@
+tag=centos6
+
+build:
+ docker build -t code.em32.net:14567/overviewer/minecraft-overviewer:$(tag) .
+
+push:
+ docker push code.em32.net:14567/overviewer/minecraft-overviewer:$(tag)
+
+run:
+ docker run --rm --privileged -it code.em32.net:14567/overviewer/minecraft-overviewer:$(tag) /bin/bash
+
@@ -0,0 +1,37 @@
+Summary: Generates large resolution images of a Minecraft map.
+Name: Minecraft-Overviewer
+Version: {VERSION}
+Release: 1%{?dist}
+Source0: %{name}-%{version}.tar.gz
+License: GNU General Public License v3
+Group: Development/Libraries
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+Vendor: Andrew Brown <brownan@gmail.com>
+Url: http://overviewer.org/
+Requires: python-imaging, numpy
+BuildRequires: python-devel, python-imaging-devel, numpy
+
+%description
+The Minecraft Overviewer is a command-line tool for rendering high-resolution
+maps of Minecraft worlds. It generates a set of static html and image files and
+uses the Google Maps API to display a nice interactive map.
+
+%prep
+%setup -n %{name}
+
+%build
+env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+
+%install
+%{__python} setup.py install -O1 --root=%{buildroot}
+rm -rf %{buildroot}%{_defaultdocdir}/minecraft-overviewer
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%{python_sitearch}/Minecraft_Overviewer-*-*.egg-info
+%{python_sitearch}/overviewer_core
+%{_bindir}/overviewer.py
+%doc README.rst COPYING.txt sample_config.py
@@ -0,0 +1,5 @@
+FROM code.em32.net:14567/overviewer/minecraft-overviewer:base
+RUN yum -y install mock
+RUN useradd --create-home --groups mock overviewer
+USER overviewer
+
@@ -0,0 +1,11 @@
+tag=centos7
+
+build:
+ docker build -t code.em32.net:14567/overviewer/minecraft-overviewer:$(tag) .
+
+push:
+ docker push code.em32.net:14567/overviewer/minecraft-overviewer:$(tag)
+
+run:
+ docker run --rm --privileged -it code.em32.net:14567/overviewer/minecraft-overviewer:$(tag) /bin/bash
+
@@ -0,0 +1,37 @@
+Summary: Generates large resolution images of a Minecraft map.
+Name: Minecraft-Overviewer
+Version: {VERSION}
+Release: 1%{?dist}
+Source0: %{name}-%{version}.tar.gz
+License: GNU General Public License v3
+Group: Development/Libraries
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+Vendor: Andrew Brown <brownan@gmail.com>
+Url: http://overviewer.org/
+Requires: python-imaging, numpy
+BuildRequires: python-devel, python-imaging-devel, numpy
+
+%description
+The Minecraft Overviewer is a command-line tool for rendering high-resolution
+maps of Minecraft worlds. It generates a set of static html and image files and
+uses the Google Maps API to display a nice interactive map.
+
+%prep
+%setup -n %{name}
+
+%build
+env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+
+%install
+%{__python} setup.py install -O1 --root=%{buildroot}
+rm -rf %{buildroot}%{_defaultdocdir}/minecraft-overviewer
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%{python_sitearch}/Minecraft_Overviewer-*-*.egg-info
+%{python_sitearch}/overviewer_core
+%{_bindir}/overviewer.py
+%doc README.rst COPYING.txt sample_config.py
@@ -0,0 +1,2 @@
+FROM debian:jessie
+RUN apt-get -y update && apt-get -y install git build-essential python-numpy python-pil python-dev python-imaging python-all-dev devscripts wget
@@ -0,0 +1,11 @@
+tag=debian64
+
+build:
+ docker build -t code.em32.net:14567/overviewer/minecraft-overviewer:$(tag) .
+
+push:
+ docker push code.em32.net:14567/overviewer/minecraft-overviewer:$(tag)
+
+run:
+ docker run --rm --privileged -it code.em32.net:14567/overviewer/minecraft-overviewer:$(tag) /bin/bash
+
@@ -0,0 +1,5 @@
+minecraft-overviewer ({VERSION}-0~overviewer1) unstable; urgency=low
+
+ * Automatically generated from Git: {DESC}
+
+ -- Aaron Griffith <agrif@overviewer.org> {DATE}
@@ -0,0 +1 @@
+7
@@ -0,0 +1,13 @@
+Source: minecraft-overviewer
+Maintainer: Aaron Griffith <agrif@overviewer.org>
+Section: python
+Priority: optional
+Build-Depends: python-all-dev (>= 2.6), debhelper (>= 7.4.3), python-imaging, python-numpy
+Standards-Version: 3.9.1
+
+Package: minecraft-overviewer
+Architecture: any
+Homepage: http://overviewer.org/
+XB-Python-Version: ${python:Versions}
+Depends: ${misc:Depends}, python2.7 | python2.6, python (>= 2.6), python (<< 2.8), python-imaging, python-numpy, ${shlibs:Depends}
+Description: Generates large resolution images of a Minecraft map.
Oops, something went wrong.

0 comments on commit b81661d

Please sign in to comment.