commit:     a54700e4a43337e3d43c8fdb88863efb9c897227
Author:     Konstantinos Smanis <konstantinos.smanis <AT> gmail <DOT> com>
AuthorDate: Thu Dec 10 19:38:59 2020 +0000
Commit:     Alexys Jacob <ultrabug <AT> gentoo <DOT> org>
CommitDate: Sat Feb 13 17:51:01 2021 +0000
URL:        https://gitweb.gentoo.org/proj/docker-images.git/commit/?id=a54700e4

Ignore missing manifests when creating manifest lists

Signed-off-by: Konstantinos Smanis <konstantinos.smanis <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo-docker-images/pull/102
Signed-off-by: Alexys Jacob <ultrabug <AT> gentoo.org>

 deploy.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/deploy.sh b/deploy.sh
index 72f90e6..f900278 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -40,7 +40,10 @@ IFS=';' read -ra ARCHES <<< "${MANIFEST_ARCHES[${MANIFEST}]}"
 
 TAGS=()
 for ARCH in "${ARCHES[@]}"; do
-       TAGS+=("${ORG}/${NAME}:${ARCH}${SUFFIX:+-${SUFFIX}}")
+       TAG="${ORG}/${NAME}:${ARCH}${SUFFIX:+-${SUFFIX}}"
+       if docker manifest inspect "${TAG}" 1>/dev/null 2>&1; then
+               TAGS+=("${TAG}")
+       fi
 done
 
 docker manifest create "${ORG}/${MANIFEST}" "${TAGS[@]}"
@@ -51,7 +54,10 @@ MANIFEST="${NAME}:${SUFFIX:+${SUFFIX}-}${VERSION}"
 
 TAGS=()
 for ARCH in "${ARCHES[@]}"; do
-       TAGS+=("${ORG}/${NAME}:${ARCH}${SUFFIX:+-${SUFFIX}}-${VERSION}")
+       TAG="${ORG}/${NAME}:${ARCH}${SUFFIX:+-${SUFFIX}}-${VERSION}"
+       if docker manifest inspect "${TAG}" 1>/dev/null 2>&1; then
+               TAGS+=("${TAG}")
+       fi
 done
 
 docker manifest create "${ORG}/${MANIFEST}" "${TAGS[@]}"

Reply via email to