forked from pi-hole/docker-pi-hole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gh-actions-test.sh
executable file
·35 lines (30 loc) · 1.21 KB
/
gh-actions-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -ex
# Script ran by Github actions for tests
#
# @environment ${ARCH} The architecture to build. Example: amd64.
# @environment ${DEBIAN_VERSION} Debian version to build. ('buster' or 'stretch').
# @environment ${ARCH_IMAGE} What the Docker Hub Image should be tagged as. Example: pihole/pihole:master-amd64-buster
# setup qemu/variables
docker run --rm --privileged multiarch/qemu-user-static:register --reset > /dev/null
. gh-actions-vars.sh
if [[ "$1" == "enter" ]]; then
enter="-it --entrypoint=sh"
fi
# generate and build dockerfile
docker build --tag image_pipenv --file Dockerfile_build .
docker run --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd):/$(pwd)" \
--workdir "$(pwd)" \
--env PIPENV_CACHE_DIR="$(pwd)/.pipenv" \
--env ARCH="${ARCH}" \
--env ARCH_IMAGE="${ARCH_IMAGE}" \
--env DEBIAN_VERSION="${DEBIAN_VERSION}" \
--env GIT_TAG="${GIT_TAG}" \
--env CORE_VERSION="${CORE_VERSION}" \
--env WEB_VERSION="${WEB_VERSION}" \
--env FTL_VERSION="${FTL_VERSION}" \
${enter} image_pipenv
mkdir -p ".gh-workspace/${DEBIAN_VERSION}/"
echo "${ARCH_IMAGE}" | tee "./.gh-workspace/${DEBIAN_VERSION}/${ARCH}"