1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-28 20:20:57 +02:00
docker-pi-hole/build-and-test.sh
Adam Warner 1d59f257ff
Reorganise the repository
Simplify the test suite now that we use buildx to build the final image
Remove tests that were never run/skipped in previous runs (same number of tests passing as were before)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-07-15 17:43:09 +01:00

21 lines
592 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
if [[ "$1" == "enter" ]]; then
enter="-it --entrypoint=bash"
fi
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed "s/\//-/g")
GIT_TAG=$(git describe --tags --exact-match 2> /dev/null || true)
GIT_TAG="${GIT_TAG:-$GIT_BRANCH}"
# generate and build dockerfile
docker build --tag image_pipenv --file test/Dockerfile test/
docker run --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd):/$(pwd)" \
--workdir "$(pwd)" \
--env PIPENV_CACHE_DIR="$(pwd)/.pipenv" \
--env GIT_TAG="${GIT_TAG}" \
${enter} image_pipenv