broken broken broken

This commit is contained in:
Your Name
2025-05-03 21:53:11 +12:00
parent 0c2b90cf8e
commit 46ca0003af
13 changed files with 12 additions and 203 deletions

View File

@ -1,28 +1,17 @@
#!/bin/bash
# INSTALL SCRIPT
# The install script is required for all templates.
# It is used to install the service on the server.
# It is called with the path to the server specific env file as an argument.
source "$(dirname "$0")/_common.sh"
# Required environment variables
source "$AGENT_PATH/_common.sh"
check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "DATA_VOLUME" "CONFIG_VOLUME"
if ! autocreate volume=$DATA_VOLUME volume=$CONFIG_VOLUME; then
die "Failed to autocreate volumes and paths"
fi
# 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"
[ -f "${CONFIG_PATH}/Caddyfile" ] || die "Caddyfile not found in ${CONFIG_PATH}!"
# remove and restart, as the env may have changed.
bash ./stop.sh || die "Failed to stop container ${CONTAINER_NAME}"
_remove_container $CONTAINER_NAME || die "Failed to remove container ${CONTAINER_NAME}"
bash ./start.sh || die "Failed to start container ${CONTAINER_NAME}"