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) images+=($arch_image)
done done
docker manifest create $MULTIARCH_IMAGE ${images[*]} for docker_tag in $MULTIARCH_IMAGE $LATEST_IMAGE; do
for arch in *; do docker manifest create $docker_tag ${images[*]}
arch_image=$(cat $arch) for arch in *; do
docker pull $arch_image arch_image=$(cat $arch)
annotate "$MULTIARCH_IMAGE" "$arch_image" "$arch" docker pull $arch_image
done annotate "$docker_tag" "$arch_image" "$arch"
done
docker manifest inspect "$MULTIARCH_IMAGE" docker manifest inspect "$docker_tag"
docker manifest push "$MULTIARCH_IMAGE" docker manifest push "$docker_tag"
done;
fi fi

View File

@ -32,6 +32,15 @@ if [[ -n "$DOCKER_TAG" ]]; then
# latest- sometimes has a trailing slash, remove it # latest- sometimes has a trailing slash, remove it
ARCH_IMAGE="${ARCH_IMAGE/%-/}" ARCH_IMAGE="${ARCH_IMAGE/%-/}"
fi 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" MULTIARCH_IMAGE="$BASE_IMAGE:$DOCKER_TAG"
set +a set +a