Try to deploy latest if the circle build matches latest tag

Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
Adam Hill 2020-02-25 21:39:39 -06:00
parent 76d2578b77
commit 730ee6952a
2 changed files with 19 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,15 @@ if [[ -n "$DOCKER_TAG" ]]; then
# latest- sometimes has a trailing slash, remove it
ARCH_IMAGE="${ARCH_IMAGE/%-/}"
fi
if ! latesttag=$(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" "${CROSS}"
else
if [[ "$DOCKER_TAG" == "$latest_tag" ]] ; then
LATEST_IMAGE="$BASE_IMAGE:latest"
fi
fi
MULTIARCH_IMAGE="$BASE_IMAGE:$DOCKER_TAG"
set +a