From 25888a35176739bb104191343890bed6b34e128a Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sun, 12 Nov 2017 22:06:57 +0100 Subject: [PATCH] travis stuff --- .travis.yml | 21 ++++++++++++++ scripts/docker/archlinux-build/Dockerfile | 16 +++++++++++ scripts/docker/archlinux-run/Dockerfile | 13 +++++++++ scripts/docker/centos-build-latest/Dockerfile | 19 +++++++++++++ scripts/docker/debian-build-latest/Dockerfile | 17 +++++++++++ .../docker/debian-build-testing/Dockerfile | 17 +++++++++++ scripts/docker/exec.bash | 28 +++++++++++++++++++ scripts/docker/ubuntu-build-devel/Dockerfile | 17 +++++++++++ scripts/docker/ubuntu-build-latest/Dockerfile | 17 +++++++++++ scripts/docker/ubuntu-build-latest/env | 1 + 10 files changed, 166 insertions(+) create mode 100644 .travis.yml create mode 100644 scripts/docker/archlinux-build/Dockerfile create mode 100644 scripts/docker/archlinux-run/Dockerfile create mode 100644 scripts/docker/centos-build-latest/Dockerfile create mode 100644 scripts/docker/debian-build-latest/Dockerfile create mode 100644 scripts/docker/debian-build-testing/Dockerfile create mode 100755 scripts/docker/exec.bash create mode 100644 scripts/docker/ubuntu-build-devel/Dockerfile create mode 100644 scripts/docker/ubuntu-build-latest/Dockerfile create mode 100644 scripts/docker/ubuntu-build-latest/env diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f83818b --- /dev/null +++ b/.travis.yml @@ -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 index 0000000..12d26f6 --- /dev/null +++ b/scripts/docker/archlinux-build/Dockerfile @@ -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 index 0000000..ed69ac9 --- /dev/null +++ b/scripts/docker/archlinux-run/Dockerfile @@ -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 index 0000000..3331276 --- /dev/null +++ b/scripts/docker/centos-build-latest/Dockerfile @@ -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 index 0000000..79b8fcf --- /dev/null +++ b/scripts/docker/debian-build-latest/Dockerfile @@ -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 index 0000000..8b422ea --- /dev/null +++ b/scripts/docker/debian-build-testing/Dockerfile @@ -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 index 0000000..9874c9a --- /dev/null +++ b/scripts/docker/exec.bash @@ -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 index 0000000..0415f52 --- /dev/null +++ b/scripts/docker/ubuntu-build-devel/Dockerfile @@ -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 index 0000000..ae344bd --- /dev/null +++ b/scripts/docker/ubuntu-build-latest/Dockerfile @@ -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 index 0000000..13f8143 --- /dev/null +++ b/scripts/docker/ubuntu-build-latest/env @@ -0,0 +1 @@ +LDXXFLAGS=-L/usr/lib/x86_64-linux-gnu -- 2.39.2