Merge pull request #582 from pi-hole/latest_deploy

Latest deploy
This commit is contained in:
Adam Hill 2020-02-26 10:33:36 -06:00 committed by GitHub
commit b39a6af9b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 8 deletions

View File

@ -37,13 +37,15 @@ if [[ "$CIRCLE_PR_NUMBER" == "" ]]; then
images+=($arch_image)
done
docker manifest create $MULTIARCH_IMAGE ${images[*]}
for arch in *; do
arch_image=$(cat $arch)
docker pull $arch_image
annotate "$MULTIARCH_IMAGE" "$arch_image" "$arch"
done
for docker_tag in $MULTIARCH_IMAGE $LATEST_IMAGE; do
docker manifest create $docker_tag ${images[*]}
for arch in *; do
arch_image=$(cat $arch)
docker pull $arch_image
annotate "$docker_tag" "$arch_image" "$arch"
done
docker manifest inspect "$MULTIARCH_IMAGE"
docker manifest push "$MULTIARCH_IMAGE"
docker manifest inspect "$docker_tag"
docker manifest push "$docker_tag"
done;
fi

View File

@ -32,6 +32,17 @@ if [[ -n "$DOCKER_TAG" ]]; then
# latest- sometimes has a trailing slash, remove it
ARCH_IMAGE="${ARCH_IMAGE/%-/}"
fi
# To get latest released, cut a release on https://github.com/pi-hole/docker-pi-hole/releases (manually gated for quality control)
latest_tag=''
if ! latest_tag=$(curl -sI https://github.com/pi-hole/docker-pi-hole/releases/latest | grep --color=never -i Location | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then
print "Failed to retrieve latest docker-pi-hole release metadata"
else
if [[ "$DOCKER_TAG" == "$latest_tag" ]] ; then
LATEST_IMAGE="$BASE_IMAGE:latest"
fi
fi
MULTIARCH_IMAGE="$BASE_IMAGE:$DOCKER_TAG"
set +a