This commit is contained in:
Your Name
2025-04-25 10:48:38 +12:00
parent 5dd4a9dce6
commit 5e8ec90064
25 changed files with 566 additions and 64 deletions

16
templates/example/_install.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
source "$(dirname "$0")/_common.sh"
load_env "$1" || die "Failed to load environment variables"
# Test Docker
_check_docker_installed || die "Docker test failed, aborting installation..."
# check can pull image on remote host and exit if fails
docker pull "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG" || die "Failed to pull image $IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"
# remove and restart, as the env may have changed.
bash ./stop.sh $1 || die "Failed to stop container ${CONTAINER_NAME}"
_remove_container $CONTAINER_NAME || die "Failed to remove container ${CONTAINER_NAME}"
bash ./start.sh $1 || die "Failed to start container ${CONTAINER_NAME}"
echo "Installation of ${CONTAINER_NAME} complete"