.
This commit is contained in:
30
templates/squashkiwi/update.sh
Executable file
30
templates/squashkiwi/update.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Source common functions
|
||||
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
|
||||
|
||||
# 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
|
||||
start_container
|
||||
|
Reference in New Issue
Block a user