From e4051982e2c1cba2294e80e96df5a6ac6eb08774 Mon Sep 17 00:00:00 2001 From: Torben Haack Date: Thu, 10 Oct 2024 13:02:28 +0200 Subject: [PATCH] fix installation script --- packages/reservation-platform/docker/build_image.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/reservation-platform/docker/build_image.sh b/packages/reservation-platform/docker/build_image.sh index 2b14d7f..24368ec 100755 --- a/packages/reservation-platform/docker/build_image.sh +++ b/packages/reservation-platform/docker/build_image.sh @@ -23,8 +23,16 @@ fi echo "Docker image built successfully" # Compress the tar file using xz -echo "Compressing the image to docker/${IMAGE_NAME}_${IMAGE_TAG}.tar.xz..." -rm "${IMAGE_NAME}_${IMAGE_TAG}.tar.xz" +COMPRESSED_FILE="docker/${IMAGE_NAME}_${IMAGE_TAG}.tar.xz" +echo "Compressing the image to $COMPRESSED_FILE..." + +# Check if the compressed file exists and remove it +if [ -f "$COMPRESSED_FILE" ]; then + echo "Removing existing compressed file $COMPRESSED_FILE..." + rm "$COMPRESSED_FILE" +fi + +# Proceed with compression xz -z docker/${IMAGE_NAME}_${IMAGE_TAG}.tar # Check if the compression was successful