From bc3c21bd6557f787f9aa1782e67235ba5a8f3ec3 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 8 Nov 2016 17:35:31 +0100 Subject: [PATCH] some docker scripts --- scripts/docker/archlinux-build/Dockerfile | 3 +++ scripts/docker/debian-latest-build/Dockerfile | 4 ++++ scripts/docker/debian-testing-build/Dockerfile | 4 ++++ scripts/docker/exec.bash | 17 +++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 scripts/docker/archlinux-build/Dockerfile create mode 100644 scripts/docker/debian-latest-build/Dockerfile create mode 100644 scripts/docker/debian-testing-build/Dockerfile create mode 100755 scripts/docker/exec.bash diff --git a/scripts/docker/archlinux-build/Dockerfile b/scripts/docker/archlinux-build/Dockerfile new file mode 100644 index 0000000..d63f421 --- /dev/null +++ b/scripts/docker/archlinux-build/Dockerfile @@ -0,0 +1,3 @@ +FROM rafaelsoares/archlinux-devel + +RUN sudo pacman -S --noconfirm git glew glm sdl2 sdl2_image sdl2_net sdl2_ttf openal freealut zlib cppunit diff --git a/scripts/docker/debian-latest-build/Dockerfile b/scripts/docker/debian-latest-build/Dockerfile new file mode 100644 index 0000000..28c1e1c --- /dev/null +++ b/scripts/docker/debian-latest-build/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:latest + +RUN apt update +RUN apt -y install --no-install-recommends build-essential libglew-dev libglm-dev libsdl2-dev libsdl2-image-dev libsdl2-net-dev libsdl2-ttf-dev libopenal-dev libalut-dev zlib1g-dev libcppunit-dev diff --git a/scripts/docker/debian-testing-build/Dockerfile b/scripts/docker/debian-testing-build/Dockerfile new file mode 100644 index 0000000..ae387e4 --- /dev/null +++ b/scripts/docker/debian-testing-build/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:testing + +RUN apt update +RUN apt -y install --no-install-recommends build-essential libglew-dev libglm-dev libsdl2-dev libsdl2-image-dev libsdl2-net-dev libsdl2-ttf-dev libopenal-dev libalut-dev zlib1g-dev libcppunit-dev diff --git a/scripts/docker/exec.bash b/scripts/docker/exec.bash new file mode 100755 index 0000000..b146e76 --- /dev/null +++ b/scripts/docker/exec.bash @@ -0,0 +1,17 @@ +#!/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}" + +if [[ "$TARGETS" == *codecov* ]]; then + ci_env=`bash <(curl -s https://codecov.io/env)` +fi + +docker build -t "blank/${IMAGE}" scripts/docker/"${IMAGE}" +docker run -v "$PWD":/repo ${ci_env} "blank/${IMAGE}" /bin/bash -c "cd /repo && make -j\$(nproc) $TARGETS" -- 2.39.2