parent
c45bf4c8dd
commit
d7a125a706
|
@ -28,7 +28,7 @@ THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
|||
base_vars = {
|
||||
'name': 'pihole/pihole',
|
||||
'maintainer' : 'adam@diginc.us',
|
||||
's6_version' : 'v1.21.4.0',
|
||||
's6_version' : 'v1.21.7.0',
|
||||
}
|
||||
|
||||
os_base_vars = {
|
||||
|
@ -37,7 +37,7 @@ os_base_vars = {
|
|||
}
|
||||
|
||||
images = {
|
||||
'v4.0': [
|
||||
'v4.1': [
|
||||
{
|
||||
'base': 'pihole/debian-base:latest',
|
||||
'arch': 'amd64'
|
||||
|
@ -95,7 +95,7 @@ def build_dockerfiles(args):
|
|||
if arch == 'armel':
|
||||
print "Skipping armel, incompatible upstream binaries/broken"
|
||||
continue
|
||||
build('pihole', 'v4.0', arch, args)
|
||||
build('pihole', 'v4.1', arch, args)
|
||||
|
||||
|
||||
def build(docker_repo, version, arch, args):
|
||||
|
|
|
@ -29,7 +29,7 @@ EXPOSE 443
|
|||
ENV S6_LOGGING 0
|
||||
ENV S6_KEEP_ENV 1
|
||||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||
ENV FTL_CMD no-daemon
|
||||
ENV FTL_CMD debug
|
||||
|
||||
ENV VERSION {{ pihole.version }}
|
||||
ENV ARCH {{ pihole.arch }}
|
||||
|
|
|
@ -29,13 +29,13 @@ EXPOSE 443
|
|||
ENV S6_LOGGING 0
|
||||
ENV S6_KEEP_ENV 1
|
||||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||
ENV FTL_CMD no-daemon
|
||||
ENV FTL_CMD debug
|
||||
|
||||
ENV VERSION v4.0
|
||||
ENV VERSION v4.1
|
||||
ENV ARCH aarch64
|
||||
ENV PATH /opt/pihole:${PATH}
|
||||
|
||||
LABEL image="pihole/pihole:v4.0_aarch64"
|
||||
LABEL image="pihole/pihole:v4.1_aarch64"
|
||||
LABEL maintainer="adam@diginc.us"
|
||||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ EXPOSE 443
|
|||
ENV S6_LOGGING 0
|
||||
ENV S6_KEEP_ENV 1
|
||||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||
ENV FTL_CMD no-daemon
|
||||
ENV FTL_CMD debug
|
||||
|
||||
ENV VERSION v4.0
|
||||
ENV VERSION v4.1
|
||||
ENV ARCH amd64
|
||||
ENV PATH /opt/pihole:${PATH}
|
||||
|
||||
LABEL image="pihole/pihole:v4.0_amd64"
|
||||
LABEL image="pihole/pihole:v4.1_amd64"
|
||||
LABEL maintainer="adam@diginc.us"
|
||||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ EXPOSE 443
|
|||
ENV S6_LOGGING 0
|
||||
ENV S6_KEEP_ENV 1
|
||||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||
ENV FTL_CMD no-daemon
|
||||
ENV FTL_CMD debug
|
||||
|
||||
ENV VERSION v4.0
|
||||
ENV VERSION v4.1
|
||||
ENV ARCH armel
|
||||
ENV PATH /opt/pihole:${PATH}
|
||||
|
||||
LABEL image="pihole/pihole:v4.0_armel"
|
||||
LABEL image="pihole/pihole:v4.1_armel"
|
||||
LABEL maintainer="adam@diginc.us"
|
||||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ EXPOSE 443
|
|||
ENV S6_LOGGING 0
|
||||
ENV S6_KEEP_ENV 1
|
||||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||
ENV FTL_CMD no-daemon
|
||||
ENV FTL_CMD debug
|
||||
|
||||
ENV VERSION v4.0
|
||||
ENV VERSION v4.1
|
||||
ENV ARCH armhf
|
||||
ENV PATH /opt/pihole:${PATH}
|
||||
|
||||
LABEL image="pihole/pihole:v4.0_armhf"
|
||||
LABEL image="pihole/pihole:v4.1_armhf"
|
||||
LABEL maintainer="adam@diginc.us"
|
||||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
|
|
14
install.sh
14
install.sh
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash -ex
|
||||
#!/bin/bash -ex /
|
||||
|
||||
mkdir -p /etc/pihole/
|
||||
mkdir -p /var/run/pihole
|
||||
# Production tags with valid web footers
|
||||
export CORE_TAG='v4.0'
|
||||
export WEB_TAG='v4.0'
|
||||
export CORE_TAG='v4.1'
|
||||
export WEB_TAG='v4.1'
|
||||
# Only use for pre-production / testing
|
||||
export USE_CUSTOM_BRANCHES=false
|
||||
|
||||
|
@ -14,7 +14,7 @@ curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C /
|
|||
mv /init /s6-init
|
||||
|
||||
if [[ $USE_CUSTOM_BRANCHES == true ]] ; then
|
||||
CORE_TAG='development'
|
||||
CORE_TAG='release/v4.1'
|
||||
fi
|
||||
|
||||
# debconf-apt-progress seems to hang so get rid of it too
|
||||
|
@ -67,10 +67,12 @@ mv "${tmpLog}" /
|
|||
|
||||
if [[ $USE_CUSTOM_BRANCHES == true ]] ; then
|
||||
ln -s /bin/true /usr/local/bin/service
|
||||
echo "$CORE_TAG" | tee /etc/pihole/ftlbranch
|
||||
ln -s /bin/true /usr/local/bin/update-rc.d
|
||||
echo y | bash -x pihole checkout core $CORE_TAG
|
||||
echo y | bash -x pihole checkout web $CORE_TAG
|
||||
echo y | bash -x pihole checkout ftl ${CORE_TAG/v/}
|
||||
unlink /usr/local/bin/service
|
||||
unlink /usr/local/bin/update-rc.d
|
||||
else
|
||||
# Reset to our tags so version numbers get detected correctly
|
||||
pushd "${PI_HOLE_LOCAL_REPO}"; git reset --hard "${CORE_TAG}"; popd;
|
||||
|
@ -86,5 +88,5 @@ sed -i $'s/updatePiholeFunc;;/unsupportedFunc;;/g' /usr/local/bin/pihole
|
|||
touch /.piholeFirstBoot
|
||||
|
||||
# Fix dnsmasq in docker
|
||||
grep -q '^user=root' || echo -e '\nuser=root' >> /etc/dnsmasq.conf
|
||||
#grep -q '^user=root' || echo -e '\nuser=root' >> /etc/dnsmasq.conf
|
||||
echo 'Docker install successful'
|
||||
|
|
|
@ -10,6 +10,10 @@ fi
|
|||
# used to start dnsmasq here for gravity to use...now that conflicts port 53
|
||||
|
||||
$bashCmd /start.sh
|
||||
# Gotta go fast, no time for gravity
|
||||
if [ -n "$PYTEST" ]; then
|
||||
sed -i 's/^gravity_spinup$/#gravity_spinup # DISABLED FOR PYTEST/g' "$(which gravity.sh)"
|
||||
fi
|
||||
gravity.sh
|
||||
|
||||
# Kill dnsmasq because s6 won't like it if it's running when s6 services start
|
||||
|
|
|
@ -8,7 +8,7 @@ check_output = testinfra.get_backend(
|
|||
def DockerGeneric(request, args, image, cmd, entrypoint=''):
|
||||
assert 'docker' in check_output('id'), "Are you in the docker group?"
|
||||
if 'pihole' in image:
|
||||
args += " --dns 127.0.0.1 -v /dev/null:/etc/pihole/adlists.default -e PYTEST=\"True\""
|
||||
args += " --dns 127.0.0.1 --dns 1.1.1.1 -v /dev/null:/etc/pihole/adlists.default -e PYTEST=1"
|
||||
docker_run = "docker run -d {args} {entry} {image} {cmd}".format(args=args, entry=entrypoint, image=image, cmd=cmd)
|
||||
print docker_run
|
||||
docker_id = check_output(docker_run)
|
||||
|
@ -67,7 +67,7 @@ def arch(request):
|
|||
@pytest.fixture()
|
||||
def version(request):
|
||||
''' TODO: include from external .py that can be shared with Dockerfile.py / Tests / deploy scripts '''
|
||||
return 'v4.0'
|
||||
return 'v4.1'
|
||||
|
||||
@pytest.fixture()
|
||||
def tag(request, version, arch):
|
||||
|
@ -95,7 +95,7 @@ def persist_arch(request):
|
|||
@pytest.fixture(scope='module')
|
||||
def persist_version(request):
|
||||
''' TODO: include from external .py that can be shared with Dockerfile.py / Tests / deploy scripts '''
|
||||
return 'v4.0'
|
||||
return 'v4.1'
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def persist_args(request):
|
||||
|
|
|
@ -21,7 +21,8 @@ def test_IPv6_not_True_removes_ipv6(Docker, args, expected_ipv6, expected_stdout
|
|||
assert "Using {}".format(expected_stdout) in function.stdout
|
||||
if expected_stdout == 'IPv4':
|
||||
assert 'IPv6' not in function.stdout
|
||||
time.sleep(.25)
|
||||
# weird slow write/sync problem; no sleep == old state of file, sleep == updated/setup state of file
|
||||
time.sleep(1)
|
||||
config = Docker.run('grep \'use-ipv6.pl\' {}'.format(WEB_CONFIG)).stdout
|
||||
assert (IPV6_LINE in config) == expected_ipv6
|
||||
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -7,7 +7,7 @@ deps = -rrequirements.txt
|
|||
# 2 parallel max b/c race condition with docker fixture (I think?)
|
||||
commands = docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
./Dockerfile.py -v --arch amd64
|
||||
pytest -vv -n auto -k amd64 ./test/
|
||||
pytest -vv -n 2 -k amd64 ./test/
|
||||
./Dockerfile.py -v --arch armhf --arch aarch64
|
||||
pytest -vv -n auto -k armhf ./test/
|
||||
pytest -vv -n auto -k aarch64 ./test/
|
||||
pytest -vv -n 2 -k armhf ./test/
|
||||
pytest -vv -n 2 -k aarch64 ./test/
|
||||
|
|
Loading…
Reference in New Issue