]> git.localhorst.tv Git - blobs.git/commitdiff
travis stuff
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 12 Nov 2017 21:06:57 +0000 (22:06 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 12 Nov 2017 21:06:57 +0000 (22:06 +0100)
.travis.yml [new file with mode: 0644]
scripts/docker/archlinux-build/Dockerfile [new file with mode: 0644]
scripts/docker/archlinux-run/Dockerfile [new file with mode: 0644]
scripts/docker/centos-build-latest/Dockerfile [new file with mode: 0644]
scripts/docker/debian-build-latest/Dockerfile [new file with mode: 0644]
scripts/docker/debian-build-testing/Dockerfile [new file with mode: 0644]
scripts/docker/exec.bash [new file with mode: 0755]
scripts/docker/ubuntu-build-devel/Dockerfile [new file with mode: 0644]
scripts/docker/ubuntu-build-latest/Dockerfile [new file with mode: 0644]
scripts/docker/ubuntu-build-latest/env [new file with mode: 0644]

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..f83818b
--- /dev/null
@@ -0,0 +1,21 @@
+# vim: sts=2 sw=2 et:
+
+os: linux
+dist: trusty
+group: stable
+
+language: cpp
+services:
+- docker
+
+matrix:
+  include:
+    - env: "IMAGE=archlinux-build TARGETS=codecov"
+    - env: "IMAGE=debian-build:latest TARGETS=test"
+    - env: "IMAGE=debian-build:testing TARGETS=test"
+    - env: "IMAGE=ubuntu-build:latest TARGETS=test"
+    - env: "IMAGE=ubuntu-build:devel TARGETS=test"
+    - env: "IMAGE=centos-build:latest TARGETS=test"
+
+script:
+    - bash scripts/docker/exec.bash
diff --git a/scripts/docker/archlinux-build/Dockerfile b/scripts/docker/archlinux-build/Dockerfile
new file mode 100644 (file)
index 0000000..12d26f6
--- /dev/null
@@ -0,0 +1,16 @@
+FROM rafaelsoares/archlinux-devel
+
+RUN sudo pacman -S --noconfirm \
+       cppcheck \
+       cppunit \
+       freealut \
+       git \
+       glew \
+       glm \
+       openal \
+       sdl2 \
+       sdl2_image \
+       sdl2_net \
+       sdl2_ttf \
+       zlib \
+       ;
diff --git a/scripts/docker/archlinux-run/Dockerfile b/scripts/docker/archlinux-run/Dockerfile
new file mode 100644 (file)
index 0000000..ed69ac9
--- /dev/null
@@ -0,0 +1,13 @@
+FROM rafaelsoares/archlinux
+
+RUN sudo pacman -S --noconfirm \
+       freealut \
+       glew \
+       glm \
+       openal \
+       sdl2 \
+       sdl2_image \
+       sdl2_net \
+       sdl2_ttf \
+       zlib \
+       ;
diff --git a/scripts/docker/centos-build-latest/Dockerfile b/scripts/docker/centos-build-latest/Dockerfile
new file mode 100644 (file)
index 0000000..3331276
--- /dev/null
@@ -0,0 +1,19 @@
+FROM centos:latest
+
+RUN yum -y update \
+       && yum -y install epel-release \
+       && yum -y update \
+       && yum -y group install "Development Tools"
+RUN yum -y install \
+       cppcheck \
+       cppunit-devel \
+       freealut-devel \
+       glew-devel \
+       glm-devel \
+       openal-soft-devel \
+       SDL2-devel \
+       SDL2_image-devel \
+       SDL2_net-devel \
+       SDL2_ttf-devel \
+       zlib-devel \
+       ;
diff --git a/scripts/docker/debian-build-latest/Dockerfile b/scripts/docker/debian-build-latest/Dockerfile
new file mode 100644 (file)
index 0000000..79b8fcf
--- /dev/null
@@ -0,0 +1,17 @@
+FROM debian:latest
+
+RUN apt update \
+       && apt -y install build-essential
+RUN apt -y install --no-install-recommends \
+       cppcheck \
+       libalut-dev \
+       libcppunit-dev \
+       libglew-dev \
+       libglm-dev \
+       libopenal-dev \
+       libsdl2-dev \
+       libsdl2-image-dev \
+       libsdl2-net-dev \
+       libsdl2-ttf-dev \
+       zlib1g-dev \
+       ;
diff --git a/scripts/docker/debian-build-testing/Dockerfile b/scripts/docker/debian-build-testing/Dockerfile
new file mode 100644 (file)
index 0000000..8b422ea
--- /dev/null
@@ -0,0 +1,17 @@
+FROM debian:testing
+
+RUN apt update \
+       && apt -y install build-essential
+RUN apt -y install --no-install-recommends \
+       cppcheck \
+       libalut-dev \
+       libcppunit-dev \
+       libglew-dev \
+       libglm-dev \
+       libopenal-dev \
+       libsdl2-dev \
+       libsdl2-image-dev \
+       libsdl2-net-dev \
+       libsdl2-ttf-dev \
+       zlib1g-dev \
+       ;
diff --git a/scripts/docker/exec.bash b/scripts/docker/exec.bash
new file mode 100755 (executable)
index 0000000..9874c9a
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# execute from project root
+# environment varables:
+#   IMAGE:    name of the docker image to use
+#   TARGETS:  targets to pass to `make` inside the container
+#   PASS_ENV: names of environment variables to import into
+#             the container during build
+
+IMAGE="${IMAGE:-archlinux-build}"
+
+image_name="localhorsttv/${IMAGE}"
+image_path="scripts/docker/${IMAGE//:/-}"
+
+build_cmd="cd /repo && make -j\$(nproc) $TARGETS"
+
+local_conf=""
+
+if [[ "$TARGETS" == *codecov* ]]; then
+       local_conf="$local_conf $(bash <(curl -s https://codecov.io/env))"
+fi
+
+if [ -e "${image_path}/env" ]; then
+       local_conf="$local_conf --env-file ${image_path}/env"
+fi
+
+docker build -t "${image_name}" --pull=true "${image_path}"
+docker run -v "$PWD":/repo ${local_conf} "${image_name}" /bin/bash -c "${build_cmd}"
diff --git a/scripts/docker/ubuntu-build-devel/Dockerfile b/scripts/docker/ubuntu-build-devel/Dockerfile
new file mode 100644 (file)
index 0000000..0415f52
--- /dev/null
@@ -0,0 +1,17 @@
+FROM ubuntu:devel
+
+RUN apt update \
+       && apt -y install build-essential
+RUN apt -y install --no-install-recommends \
+       cppcheck \
+       libalut-dev \
+       libcppunit-dev \
+       libglew-dev \
+       libglm-dev \
+       libopenal-dev \
+       libsdl2-dev \
+       libsdl2-image-dev \
+       libsdl2-net-dev \
+       libsdl2-ttf-dev \
+       zlib1g-dev \
+       ;
diff --git a/scripts/docker/ubuntu-build-latest/Dockerfile b/scripts/docker/ubuntu-build-latest/Dockerfile
new file mode 100644 (file)
index 0000000..ae344bd
--- /dev/null
@@ -0,0 +1,17 @@
+FROM ubuntu:latest
+
+RUN apt update \
+       && apt -y install build-essential
+RUN apt -y install --no-install-recommends \
+       cppcheck \
+       libalut-dev \
+       libcppunit-dev \
+       libglew-dev \
+       libglm-dev \
+       libopenal-dev \
+       libsdl2-dev \
+       libsdl2-image-dev \
+       libsdl2-net-dev \
+       libsdl2-ttf-dev \
+       zlib1g-dev \
+       ;
diff --git a/scripts/docker/ubuntu-build-latest/env b/scripts/docker/ubuntu-build-latest/env
new file mode 100644 (file)
index 0000000..13f8143
--- /dev/null
@@ -0,0 +1 @@
+LDXXFLAGS=-L/usr/lib/x86_64-linux-gnu