Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to Master to release 4.4 #577

Merged
merged 56 commits into from Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4dffbf0
Add new optional env variable DNS_FQDN_REQUIRED
billimek Oct 16, 2019
e74f8c1
Update docker-compose.yml
cwilby Nov 13, 2019
f23ef9b
switching to circleci
diginc Dec 31, 2019
18b1f44
command typo
diginc Dec 31, 2019
0c5468b
more command fixes
diginc Dec 31, 2019
c2bca95
forgot requirements.txt
diginc Dec 31, 2019
3d8fed7
updated pip freeze
diginc Dec 31, 2019
3a0b1b1
upgrade pip
diginc Dec 31, 2019
8ab895b
bump some versions, remove unused
diginc Jan 1, 2020
8b51f53
remove armel for now
diginc Jan 1, 2020
096c6b5
added armel with manual patch for now
diginc Jan 1, 2020
9c76d24
Merge pull request #550 from pi-hole/circleci
diginc Jan 2, 2020
9c5393d
Merge branch 'dev' of github.com:diginc/docker-pi-hole into armel
diginc Jan 2, 2020
4ba5005
re-enable arm
diginc Jan 2, 2020
09eae00
Merge pull request #551 from pi-hole/armel
diginc Jan 2, 2020
23c4420
Merge pull request #524 from billimek/add_dns_fqdn_required
diginc Jan 2, 2020
8d5724e
Merge pull request #532 from cwilby/patch-1
diginc Jan 2, 2020
f34f2ce
CircleCI deployment take 1
diginc Jan 3, 2020
5c1503a
Merge branch 'dev' of github.com:pi-hole/docker-pi-hole into deploy-i…
diginc Jan 3, 2020
c3933ab
missing filter key
diginc Jan 3, 2020
2f2fb40
fix?
diginc Jan 3, 2020
6ddcd3f
fix?
diginc Jan 3, 2020
1505156
fix?
diginc Jan 3, 2020
7d54465
Remove branch, leaving just tags for wf builds to fix?
diginc Jan 4, 2020
fe3c9d2
forget why sudo is needed...
diginc Jan 4, 2020
ad6c06d
image and namespace are now defaulted but overridable
diginc Jan 14, 2020
6995122
remove dryrun
diginc Jan 14, 2020
a615d55
remove tox re-running in deploy script
diginc Jan 14, 2020
ea989a7
Preparing code for master/tags/latest image
diginc Jan 14, 2020
d880f69
Remove manfiest for now, fix namespace
diginc Jan 14, 2020
a92ea9c
correct todo comment
diginc Jan 14, 2020
939d299
Quiet things down
diginc Jan 14, 2020
3765d41
Update way too much
diginc Jan 14, 2020
1265766
finally?
diginc Jan 31, 2020
aab5310
Delete the unecessary
diginc Jan 31, 2020
8bfe969
Merge pull request #552 from pi-hole/deploy-images-from-ci
diginc Feb 3, 2020
1add81a
Fix minor spelling mistake
losuler Feb 9, 2020
bf0a919
Minor spelling mistake in README
scott-kirk Feb 9, 2020
f0a9a9f
Merge pull request #565 from scott-kirk/patch-1
diginc Feb 9, 2020
0570d26
Merge pull request #564 from losuler/dev
diginc Feb 16, 2020
c024dcd
Upgrade v4.3.3
diginc Feb 24, 2020
2fdcf19
Merge pull request #576 from pi-hole/upgrade_v4.3.3
diginc Feb 24, 2020
6bf15d6
update for core 4.3.4
PromoFaux Feb 24, 2020
c0c7221
Did I say 4.3.4? I spoke too soon
PromoFaux Feb 24, 2020
80cea50
Merge pull request #578 from pi-hole/release-v4.3.4
PromoFaux Feb 25, 2020
cf6d74a
Improve healthcheck responsiveness.
lightswitch05 Feb 25, 2020
d102ba9
Merge pull request #579 from lightswitch05/feature/improve-healthchec…
diginc Feb 25, 2020
de7e563
target core version 4.4
PromoFaux Feb 25, 2020
ca9bf8c
This should fix the tests
PromoFaux Feb 25, 2020
76d2578
Merge pull request #581 from pi-hole/v4.4
dschaper Feb 25, 2020
730ee69
Try to deploy latest if the circle build matches latest tag
diginc Feb 26, 2020
3fb82b0
typo
diginc Feb 26, 2020
91ab080
skip local scope coding, not needed
diginc Feb 26, 2020
d20bde2
Comment + test latest hub tag
diginc Feb 26, 2020
db919a2
Back to latest tag
diginc Feb 26, 2020
b39a6af
Merge pull request #582 from pi-hole/latest_deploy
diginc Feb 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,65 @@
version: 2

.job_template: &job_template
machine:
enabled: true
steps:
- checkout
- run:
command: ./circle-test.sh
- persist_to_workspace:
root: .
paths: [ 'ci-workspace' ]

jobs:
amd64:
<<: *job_template
arm64:
<<: *job_template
armhf:
<<: *job_template
armel:
<<: *job_template
deploy:
docker:
- image: circleci/python:latest
steps:
- setup_remote_docker:
version: 18.06.0-ce
- checkout
- attach_workspace:
at: .
- run:
command: ./circle-deploy.sh



workflows:
version: 2
build:
jobs:
- amd64:
filters:
tags:
only: /^v.*/
- arm64:
filters:
tags:
only: /^v.*/
- armhf:
filters:
tags:
only: /^v.*/
- armel:
filters:
tags:
only: /^v.*/
- deploy:
requires:
- amd64
- arm64
- armhf
- armel
filters:
tags:
only: /^v.*/
4 changes: 4 additions & 0 deletions .dockerignore
@@ -1 +1,5 @@
**/*.sw*
.tox
.git
**/__pycache__
.pipenv
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,9 +3,11 @@
.cache
__pycache__
.tox
.pipenv
.eggs
UNKNOWN.egg-info
.env
ci-workspace

# WIP/test stuff
doco.yml
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

84 changes: 47 additions & 37 deletions Dockerfile.py
@@ -1,23 +1,22 @@
#!/usr/bin/env python
#!/usr/bin/env python3
""" Dockerfile.py - generates and build dockerfiles

Usage:
Dockerfile.py [--arch=<arch> ...] [--skip=<arch> ...] [-v] [-t] [--no-build | --no-generate] [--no-cache]
Dockerfile.py [--hub_tag=<tag>] [--arch=<arch> ...] [-v] [-t] [--no-build | --no-generate] [--no-cache]

Options:
--no-build Skip building the docker images
--no-cache Build without using any cache data
--no-generate Skip generating Dockerfiles from template
--arch=<arch> What Architecture(s) to build [default: amd64 armel armhf aarch64]
--skip=<arch> What Architectures(s) to skip [default: None]
--hub_tag=<tag> What the Docker Hub Image should be tagged as [default: None]
--arch=<arch> What Architecture(s) to build [default: amd64 armel armhf arm64]
-v Print docker's command output [default: False]
-t Print docker's build time [default: False]

Examples:
"""
from __future__ import print_function

from docopt import docopt

from jinja2 import Environment, FileSystemLoader
from docopt import docopt
import os
Expand All @@ -29,7 +28,7 @@
base_vars = {
'name': 'pihole/pihole',
'maintainer' : 'adam@diginc.us',
's6_version' : 'v1.21.7.0',
's6_version' : 'v1.22.1.0',
}

os_base_vars = {
Expand All @@ -47,19 +46,23 @@
__version__: [
{
'base': 'pihole/debian-base:latest',
'arch': 'amd64'
'arch': 'amd64',
's6arch': 'amd64',
},
{
'base': 'multiarch/debian-debootstrap:armel-stretch-slim',
'arch': 'armel'
'arch': 'armel',
's6arch': 'arm',
},
{
'base': 'multiarch/debian-debootstrap:armhf-stretch-slim',
'arch': 'armhf'
'arch': 'arm',
's6arch' : 'arm',
},
{
'base': 'multiarch/debian-debootstrap:arm64-stretch-slim',
'arch': 'aarch64'
'arch': 'arm64',
's6arch' : 'aarch64',
}
]
}
Expand All @@ -69,19 +72,17 @@ def generate_dockerfiles(args):
print(" ::: Skipping Dockerfile generation")
return

for version, archs in images.iteritems():
for version, archs in images.items():
for image in archs:
if image['arch'] not in args['--arch'] or image['arch'] in args['--skip']:
return
s6arch = image['arch']
if image['arch'] == 'armel':
s6arch = 'arm'
if image['arch'] not in args['--arch']:
continue
s6arch = image['s6arch'] if image['s6arch'] else image['arch']
merged_data = dict(
{ 'version': version }.items() +
base_vars.items() +
os_base_vars.items() +
image.items() +
{ 's6arch': s6arch }.items()
list({ 'version': version }.items()) +
list(base_vars.items()) +
list(os_base_vars.items()) +
list(image.items()) +
list({ 's6arch': s6arch }.items())
)
j2_env = Environment(loader=FileSystemLoader(THIS_DIR),
trim_blocks=True)
Expand All @@ -98,17 +99,28 @@ def build_dockerfiles(args):
return

for arch in args['--arch']:
# TODO: include from external .py that can be shared with Dockerfile.py / Tests / deploy scripts '''
if arch == 'armel':
print("Skipping armel, incompatible upstream binaries/broken")
continue
build('pihole', arch, args)


def run_and_stream_command_output(command, args):
print("Running", command)
build_result = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
bufsize=1, universal_newlines=True)
if args['-v']:
while build_result.poll() is None:
for line in build_result.stdout:
print(line, end='')
build_result.wait()
if build_result.returncode != 0:
print(" ::: Error running".format(command))
print(build_result.stderr)


def build(docker_repo, arch, args):
dockerfile = 'Dockerfile_{}'.format(arch)
repo_tag = '{}:{}_{}'.format(docker_repo, __version__, arch)
cached_image = '{}/{}'.format('pihole', repo_tag)
print(" ::: Building {}".format(repo_tag))
time=''
if args['-t']:
time='time '
Expand All @@ -118,22 +130,20 @@ def build(docker_repo, arch, args):
build_command = '{time}docker build {no_cache} --pull --cache-from="{cache},{create_tag}" -f {dockerfile} -t {create_tag} .'\
.format(time=time, no_cache=no_cache, cache=cached_image, dockerfile=dockerfile, create_tag=repo_tag)
print(" ::: Building {} into {}".format(dockerfile, repo_tag))
run_and_stream_command_output(build_command, args)
if args['-v']:
print(build_command, '\n')
build_result = subprocess.Popen(build_command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if args['-v']:
for c in iter(lambda: build_result.stdout.read(1), b''):
sys.stdout.write(c)
build_result.wait()
if build_result.returncode != 0:
print(" ::: Building {} encountered an error".format(dockerfile))
print(build_result.stderr)
assert build_result.returncode == 0
if args['--hub_tag']:
hub_tag_command = "{time}docker tag {create_tag} {hub_tag}"\
.format(time=time, create_tag=repo_tag, hub_tag=args['--hub_tag'])
print(" ::: Tagging {} into {}".format(repo_tag, args['--hub_tag']))
run_and_stream_command_output(hub_tag_command, args)


if __name__ == '__main__':
args = docopt(__doc__, version='Dockerfile 1.0')
# print args
args = docopt(__doc__, version='Dockerfile 1.1')
if args['-v']:
print(args)

generate_dockerfiles(args)
build_dockerfiles(args)
8 changes: 8 additions & 0 deletions Dockerfile.sh
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
# alpine sh only

set -eux
./Dockerfile.py -v --arch="${ARCH}" --hub_tag="${ARCH_IMAGE}"
# TODO: Add junitxml output and have circleci consume it
# 2 parallel max b/c race condition with docker fixture (I think?)
py.test -vv -n 2 -k "${ARCH}" ./test/
5 changes: 3 additions & 2 deletions Dockerfile.template
@@ -1,6 +1,8 @@
FROM {{ pihole.base }}

ENV ARCH {{ pihole.arch }}
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/{{ pihole.s6_version }}/s6-overlay-{{ pihole.s6arch }}.tar.gz

COPY install.sh /usr/local/bin/install.sh
COPY VERSION /etc/docker-pi-hole-version
ENV PIHOLE_INSTALL /root/ph_install.sh
Expand Down Expand Up @@ -36,13 +38,12 @@ ENV FTL_CMD no-daemon
ENV DNSMASQ_USER root

ENV VERSION {{ pihole.version }}
ENV ARCH {{ pihole.arch }}
ENV PATH /opt/pihole:${PATH}

LABEL image="{{ pihole.name }}:{{ pihole.version }}_{{ pihole.arch }}"
LABEL maintainer="{{ pihole.maintainer }}"
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"

HEALTHCHECK CMD dig @127.0.0.1 pi.hole || exit 1
HEALTHCHECK CMD dig +norecurse +retry=0 @127.0.0.1 pi.hole || exit 1

SHELL ["/bin/bash", "-c"]
9 changes: 5 additions & 4 deletions Dockerfile_amd64
@@ -1,6 +1,8 @@
FROM pihole/debian-base:latest

ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-amd64.tar.gz
ENV ARCH amd64
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-amd64.tar.gz

COPY install.sh /usr/local/bin/install.sh
COPY VERSION /etc/docker-pi-hole-version
ENV PIHOLE_INSTALL /root/ph_install.sh
Expand Down Expand Up @@ -35,11 +37,10 @@ ENV ServerIP 0.0.0.0
ENV FTL_CMD no-daemon
ENV DNSMASQ_USER root

ENV VERSION v4.3.2
ENV ARCH amd64
ENV VERSION v4.4
ENV PATH /opt/pihole:${PATH}

LABEL image="pihole/pihole:v4.3.2_amd64"
LABEL image="pihole/pihole:v4.4_amd64"
LABEL maintainer="adam@diginc.us"
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"

Expand Down
9 changes: 5 additions & 4 deletions Dockerfile_aarch64 → Dockerfile_arm64
@@ -1,6 +1,8 @@
FROM multiarch/debian-debootstrap:arm64-stretch-slim

ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-aarch64.tar.gz
ENV ARCH arm64
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-aarch64.tar.gz

COPY install.sh /usr/local/bin/install.sh
COPY VERSION /etc/docker-pi-hole-version
ENV PIHOLE_INSTALL /root/ph_install.sh
Expand Down Expand Up @@ -35,11 +37,10 @@ ENV ServerIP 0.0.0.0
ENV FTL_CMD no-daemon
ENV DNSMASQ_USER root

ENV VERSION v4.3.2
ENV ARCH aarch64
ENV VERSION v4.4
ENV PATH /opt/pihole:${PATH}

LABEL image="pihole/pihole:v4.3.2_aarch64"
LABEL image="pihole/pihole:v4.4_arm64"
LABEL maintainer="adam@diginc.us"
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"

Expand Down
9 changes: 5 additions & 4 deletions Dockerfile_armel
@@ -1,6 +1,8 @@
FROM multiarch/debian-debootstrap:armel-stretch-slim

ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-arm.tar.gz
ENV ARCH armel
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-arm.tar.gz

COPY install.sh /usr/local/bin/install.sh
COPY VERSION /etc/docker-pi-hole-version
ENV PIHOLE_INSTALL /root/ph_install.sh
Expand Down Expand Up @@ -35,11 +37,10 @@ ENV ServerIP 0.0.0.0
ENV FTL_CMD no-daemon
ENV DNSMASQ_USER root

ENV VERSION v4.3.2
ENV ARCH armel
ENV VERSION v4.4
ENV PATH /opt/pihole:${PATH}

LABEL image="pihole/pihole:v4.3.2_armel"
LABEL image="pihole/pihole:v4.4_armel"
LABEL maintainer="adam@diginc.us"
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"

Expand Down
7 changes: 4 additions & 3 deletions Dockerfile_armhf
@@ -1,6 +1,8 @@
FROM multiarch/debian-debootstrap:armhf-stretch-slim

ENV ARCH armhf
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.7.0/s6-overlay-armhf.tar.gz

COPY install.sh /usr/local/bin/install.sh
COPY VERSION /etc/docker-pi-hole-version
ENV PIHOLE_INSTALL /root/ph_install.sh
Expand Down Expand Up @@ -35,11 +37,10 @@ ENV ServerIP 0.0.0.0
ENV FTL_CMD no-daemon
ENV DNSMASQ_USER root

ENV VERSION v4.3.2
ENV ARCH armhf
ENV VERSION v4.4
ENV PATH /opt/pihole:${PATH}

LABEL image="pihole/pihole:v4.3.2_armhf"
LABEL image="pihole/pihole:v4.4_armhf"
LABEL maintainer="adam@diginc.us"
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"

Expand Down