fail early

This commit is contained in:
Rok Garbas 2022-01-26 10:05:33 +01:00
parent 4fc3c4da7b
commit 50a9c48db4
No known key found for this signature in database
GPG key ID: A0E01EF44C27BF00

View file

@ -17,6 +17,13 @@ DOCKER_MANIFEST_LATEST=""
for PLATFORM in $PLATFORMS; for PLATFORM in $PLATFORMS;
do 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 ..." echo "=> Loading docker image for $PLATFORM platform ..."
DOCKER_IMAGE_TMP_FILE="$PWD/image-$PLATFORM.tar.gz" DOCKER_IMAGE_TMP_FILE="$PWD/image-$PLATFORM.tar.gz"
@ -25,13 +32,6 @@ do
fi fi
docker load -i $DOCKER_IMAGE_TMP_FILE 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 ..." echo "=> Tagging docker image of version $VERSION for $PLATFORM platform ..."
docker tag nix:$VERSION nixos/nix:$VERSION-$DOCKER_PLATFORM docker tag nix:$VERSION nixos/nix:$VERSION-$DOCKER_PLATFORM