Merge branch 'dev' of github.com:diginc/docker-pi-hole into armel

Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
Adam Hill 2020-01-01 21:25:41 -06:00
commit 9c5393dfa0
No known key found for this signature in database
GPG Key ID: 2193804FCA429855
4 changed files with 129 additions and 34 deletions

70
.circleci/config.yml Normal file
View File

@ -0,0 +1,70 @@
version: 2
.job_template: &job_template
machine:
enabled: true
steps:
- checkout
- run:
command: |
# setup qemu/variables
docker run --rm --privileged multiarch/qemu-user-static:register --reset
HUB_NAMESPACE=$CIRCLE_PROJECT_USERNAME
[[ $CIRCLE_PROJECT_USERNAME == "pi-hole" ]] && HUB_NAMESPACE="pihole"
[[ $IMAGE != *"/"* ]] && IMAGE="${HUB_NAMESPACE}/${IMAGE}"
[[ $IMAGE != *":"* ]] && IMAGE="${IMAGE}:$CIRCLE_JOB"
if [[ -n "$CIRCLE_TAG" ]]; then
# remove latest tag if used
IMAGE="${IMAGE/:latest/:}"
# and tack the github tag (version) on the front of the tag. image:arch = image:v1.0-arch
IMAGE="${IMAGE/:/:${CIRCLE_TAG}-}"
# latest gets a trailing slash, remove it
IMAGE="${IMAGE/%-/}"
fi
# generate and build dockerfile
pip install --upgrade pip
pip install -r requirements.txt
./Dockerfile.py --arch=${CIRCLE_JOB} -v
docker images
# run docker build & tests
# 2 parallel max b/c race condition with docker fixture (I think?)
py.test -vv -n 2 -k "${CIRCLE_JOB}" ./test/
# push image
# [[ "$CIRCLE_PR_NUMBER" == "" ]] && sudo docker push $IMAGE
jobs:
amd64:
<<: *job_template
aarch64:
<<: *job_template
armhf:
<<: *job_template
#armel:
# <<: *job_template
workflows:
version: 2
build:
jobs:
- amd64:
filters:
tags:
only: /^v.*/
- aarch64:
filters:
tags:
only: /^v.*/
- armhf:
filters:
tags:
only: /^v.*/
#- armel:
# filters:
# tags:
# only: /^v.*/

View File

@ -1,23 +0,0 @@
services:
- docker
language: python
env:
global:
- QEMU_VER=v2.9.1
matrix:
- ARCH=amd64
- ARCH=armhf
- ARCH=aarch64
python:
- "2.7"
install:
- pip install -r requirements.txt
script:
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# generate and build dockerfile
- ./Dockerfile.py --arch=${ARCH} -v
- docker images
# run docker build & tests
# 2 parallel max b/c race condition with docker fixture (I think?)
- py.test -vv -n 2 -k "${ARCH}" ./test/

View File

@ -1,7 +1,56 @@
docker-compose
jinja2
pytest>=3.6.0
pytest-cov
pytest-xdist
testinfra==1.5.1
tox
apipkg==1.5
atomicwrites==1.3.0
attrs==19.3.0
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.7.0.1
bcrypt==3.1.7
cached-property==1.5.1
certifi==2019.11.28
cffi==1.13.2
chardet==3.0.4
configparser==4.0.2
contextlib2==0.6.0.post1
coverage==5.0.1
cryptography==2.8
docker==4.1.0
dockerpty==0.4.1
docopt==0.6.2
enum34==1.1.6
execnet==1.7.1
filelock==3.0.12
funcsigs==1.0.2
functools32==3.2.3.post2
idna==2.8
importlib-metadata==1.3.0
ipaddress==1.0.23
Jinja2==2.10.3
jsonschema==3.2.0
MarkupSafe==1.1.1
more-itertools==5.0.0
packaging==19.2
paramiko==2.7.1
pathlib2==2.3.5
pluggy==0.13.1
py==1.8.1
pycparser==2.19
PyNaCl==1.3.0
pyparsing==2.4.6
pyrsistent==0.15.6
pytest==4.6.8
pytest-cov==2.8.1
pytest-forked==1.1.3
pytest-xdist==1.31.0
PyYAML==5.2
requests==2.22.0
scandir==1.10.0
six==1.13.0
subprocess32==3.5.4
testinfra==3.3.0
texttable==1.6.2
toml==0.10.0
tox==3.14.3
urllib3==1.25.7
virtualenv==16.7.9
wcwidth==0.1.7
websocket-client==0.57.0
zipp==0.6.0

View File

@ -3,9 +3,8 @@ import pytest
import testinfra
import os
check_output = testinfra.get_backend(
"local://"
).get_module("Command").check_output
local_host = testinfra.get_host('local://')
check_output = local_host.check_output
__version__ = None
dotdot = os.path.abspath(os.path.join(os.path.abspath(__file__), os.pardir, os.pardir))
@ -50,7 +49,7 @@ def DockerGeneric(request, _test_args, _args, _image, _cmd, _entrypoint):
check_output("docker rm -f {}".format(docker_id))
request.addfinalizer(teardown)
docker_container = testinfra.get_backend("docker://" + docker_id)
docker_container = testinfra.backend.get_backend("docker://" + docker_id)
docker_container.id = docker_id
def run_bash(self, command, *args, **kwargs):