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/.circleci/config.yml
Adam Hill f23ef9b293
switching to circleci
Signed-off-by: Adam Hill <adam@diginc.us>
2019-12-31 16:53:50 -06:00

69 lines
1.7 KiB
YAML

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
- ./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.*/