From 50a9c48db4dddd6ba4c81dae74aa60f8ff10bfe5 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Wed, 26 Jan 2022 10:05:33 +0100 Subject: [PATCH] fail early --- maintainers/push-docker.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/maintainers/push-docker.sh b/maintainers/push-docker.sh index fe8fe174e..f9c5a6b18 100755 --- a/maintainers/push-docker.sh +++ b/maintainers/push-docker.sh @@ -17,6 +17,13 @@ DOCKER_MANIFEST_LATEST="" for PLATFORM in $PLATFORMS; do + if [ "$PLATFORM" = "x86_64-linux" ]; then DOCKER_PLATFORM="amd64" + elif [ "$PLATFORM" = "aarch64-linux" ]; then DOCKER_PLATFORM="arm64" + else + echo "EROROR: No docker platform found for $PLATFORM platform" + exit 1 + fi + echo "=> Loading docker image for $PLATFORM platform ..." DOCKER_IMAGE_TMP_FILE="$PWD/image-$PLATFORM.tar.gz" @@ -25,13 +32,6 @@ do fi docker load -i $DOCKER_IMAGE_TMP_FILE - if [ "$PLATFORM" = "x86_64-linux" ]; then DOCKER_PLATFORM="amd64" - elif [ "$PLATFORM" = "aarch64-linux" ]; then DOCKER_PLATFORM="arm64" - else - echo "EROROR: No docker platform found for $PLATFORM platform" - exit 1 - fi - echo "=> Tagging docker image of version $VERSION for $PLATFORM platform ..." docker tag nix:$VERSION nixos/nix:$VERSION-$DOCKER_PLATFORM