This commit is contained in:
Your Name
2025-04-21 16:12:06 +12:00
parent 7d1db266b0
commit bd27109a2b
5 changed files with 64 additions and 65 deletions

View File

@ -33,8 +33,8 @@ fi
echo "Successfully pulled the docker image from the registry"
# remove and restart, as the env may have changed.
_stop_container $CONTAINER_NAME
_remove_container $CONTAINER_NAME
_stop_container $CONTAINER_NAME || die "Failed to stop container ${CONTAINER_NAME}"
_remove_container $CONTAINER_NAME || die "Failed to remove container ${CONTAINER_NAME}"
create_and_start_container || die "Failed to start container ${CONTAINER_NAME}"
echo "Installation complete"

View File

@ -1,32 +0,0 @@
#!/bin/bash
# Source common functions
source "$(dirname "$0")/_dockerhelper.sh"
source "$(dirname "$0")/_common.sh"
# Load environment variables
load_env "$1" || exit 1
# check can pull image on remote host and exit if fails
if ! docker pull "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"; then
echo "Failed to pull image $IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"
exit 1
fi
echo "Successfully pulled the docker image from the registry"
# stop the old container
_stop_container ${CONTAINER_NAME}
# remove the old container
grey_start
if ! docker rm "$CONTAINER_NAME"; then
echo "Failed to remove container $CONTAINER_NAME"
exit 1
fi
grey_end
echo "Successfully removed the old container"
# start the new container
create_and_start_container || die "Failed to start container ${CONTAINER_NAME}"