From b9092eb8c28dc75411d60b06b6fc4e56c89b0889 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 28 Jan 2024 10:35:37 +0100 Subject: [PATCH] Auto restart containers --- scripts/deploy_silverbullet_md.sh | 10 +++++----- scripts/deploy_silverbullet_playground.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/deploy_silverbullet_md.sh b/scripts/deploy_silverbullet_md.sh index 4f3a3aee..4c810c4a 100755 --- a/scripts/deploy_silverbullet_md.sh +++ b/scripts/deploy_silverbullet_md.sh @@ -16,10 +16,10 @@ docker pull $IMAGE_NAME AFTER_PULL=$(docker images -q $IMAGE_NAME) # Compare the image IDs -# if [ "$BEFORE_PULL" == "$AFTER_PULL" ]; then -# echo "The Docker image has not been updated. Done!" -# exit 0 -# fi +if [ "$BEFORE_PULL" == "$AFTER_PULL" ]; then + echo "The Docker image has not been updated. Done!" + exit 0 +fi echo "The Docker image has been updated, let's update the website content." git pull @@ -36,7 +36,7 @@ echo "Removing old databases" rm -f $WEBSITE_SPACE/.silverbullet.db* echo "Starting new silverbullet container" -docker run -d --name silverbullet -v $WEBSITE_SPACE:/space -e SB_READ_ONLY=1 -p $WEBSITE_PORT:3000 $IMAGE_NAME +docker run -d --name silverbullet --restart unless-stopped -v $WEBSITE_SPACE:/space -e SB_READ_ONLY=1 -p $WEBSITE_PORT:3000 $IMAGE_NAME echo "Waiting for the servers to start" diff --git a/scripts/deploy_silverbullet_playground.sh b/scripts/deploy_silverbullet_playground.sh index 9796ad71..b3ecce2b 100755 --- a/scripts/deploy_silverbullet_playground.sh +++ b/scripts/deploy_silverbullet_playground.sh @@ -33,7 +33,7 @@ cp -r scripts/playground_space/* $PLAYGROUND_SPACE/ cp -r website/Library $PLAYGROUND_SPACE/ echo "Starting new playground container" -docker run -d --name silverbullet-playground -v $PLAYGROUND_SPACE:/space -e SB_SHELL_BACKEND=off -p $PLAYGROUND_PORT:3000 $IMAGE_NAME +docker run -d --name silverbullet-playground --restart unless-stopped -v $PLAYGROUND_SPACE:/space -e SB_SHELL_BACKEND=off -p $PLAYGROUND_PORT:3000 $IMAGE_NAME echo "Waiting for the server to start"