Commit 092e3058 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Add docker image build to CI

parent 90357a3e
......@@ -84,3 +84,10 @@ build_eoan:
artifacts:
paths:
- release/debian/build/*
build_docker:
script:
- cd release/docker
- docker build --build-arg REF=`git log -n1 --pretty='%H'` -t graph-tool .
only:
- tags
ARG GIT_REF
FROM archlinux/base:latest as builder
MAINTAINER Tiago de Paula Peixoto <tiago@skewed.de>
RUN pacman -Sy
RUN pacman -S pacman-contrib --noconfirm --disable-download-timeout
RUN curl -s "https://www.archlinux.org/mirrorlist/?country=US&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 - > /etc/pacman.d/mirrorlist
RUN pacman -Syu --noconfirm --disable-download-timeout
RUN pacman -S binutils make gcc fakeroot --noconfirm --needed
RUN pacman -S expac yajl git --noconfirm --needed
RUN pacman -S sudo grep file --noconfirm --needed
RUN pacman -S sudo boost python3 python3-scipy python-numpy \
cgal cairomm python-cairo sparsehash cairomm \
autoconf-archive autoconf automake pkg-config --noconfirm --needed
ENV MAKEPKG_USER=mkpkg \
MAKEPKG_GROUP=mkpkg \
MAKEPKG_ROOT=/tmp/build
RUN groupadd "${MAKEPKG_USER}" \
&& useradd -g "${MAKEPKG_GROUP}" "${MAKEPKG_USER}"
RUN mkdir -p ${MAKEPKG_ROOT}; chown mkpkg:mkpkg ${MAKEPKG_ROOT}
WORKDIR ${MAKEPKG_ROOT}
USER ${MAKEPKG_USER}
ADD PKGBUILD PKGBUILD
RUN makepkg PKGBUILD --needed GIT_REF=$GIT_REF CXXFLAGS="-mtune=generic -O3 -pipe -flto=8 -ffunction-sections -fdata-sections" LDFLAGS="-Wl,--gc-sections"
USER root
RUN mv -v "${MAKEPKG_ROOT}/"python-graph-tool-*-x86_64.pkg.tar.xz /tmp/python-graph-tool.pkg.tar.xz
# Non-build
FROM archlinux/base:latest
RUN echo "Server=https://archive.archlinux.org/repos/`date +%Y/%m/%d`/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
COPY --from=builder /tmp/python-graph-tool.pkg.tar.xz /tmp/python-graph-tool.pkg.tar.xz
RUN pacman -Syu --noconfirm --disable-download-timeout \
&& pacman -U --noconfirm --noprogressbar --needed /tmp/python-graph-tool.pkg.tar.xz \
&& yes | pacman -Scc --noconfirm
RUN pacman -S ipython gtk3 python-gobject python-matplotlib python-pandas jupyter-notebook mathjax python-cairocffi pandoc --noconfirm --needed
RUN useradd -m -g users user
ENV PYTHONIOENCODING=utf8
# Maintainer: Tiago de Paula Peixoto <tiago@skewed.de>
# Remove the --enable-openmp flag below if you do not want parallelization.
pkgname=python-graph-tool
pkgver=git
pkgrel=1
pkgdesc='A Python module for manipulation and statistical analysis of graphs'
arch=('i686' 'x86_64')
url='https://graph-tool.skewed.de'
license=(GPL3)
depends=(boost-libs python3 expat python3-scipy python-numpy cgal cairomm python-cairo)
makedepends=(boost sparsehash cairomm python-cairo autoconf-archive)
optdepends=('graphviz: graph layout'
'python-matplotlib: graph drawing')
provides=(python3-graph-tool)
conflicts=(python3-graph-tool)
replaces=(python3-graph-tool)
options=(!libtool)
source=('git+https://git.skewed.de/count0/graph-tool.git')
sha256sums=('SKIP')
prepare() {
cd "$srcdir/graph-tool"
git checkout $GIT_REF
./autogen.sh
./configure --enable-openmp --prefix=/usr --docdir="/usr/share/doc/$pkgname"
}
build() {
cd "$srcdir/graph-tool"
make -j 8
}
check() {
cd "$srcdir/graph-tool"
make check
}
package() {
cd "$srcdir/graph-tool"
make DESTDIR="$pkgdir/" install
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment