Dropshell basic templates (WIP)
This commit is contained in:
21
watchtower/install.sh
Normal file
21
watchtower/install.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/_common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
|
||||
|
||||
# Watchtower Install Script
|
||||
|
||||
echo "Checking Docker installation..."
|
||||
_check_docker_installed || _die "Docker test failed, aborting installation..."
|
||||
|
||||
echo "Pulling image ${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG}..."
|
||||
docker pull "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG" || _die "Failed to pull image $IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"
|
||||
|
||||
echo "Stopping and removing any existing container..."
|
||||
# No need to check failure, might not exist
|
||||
_stop_container $CONTAINER_NAME
|
||||
_remove_container $CONTAINER_NAME || _die "Failed to remove container ${CONTAINER_NAME}"
|
||||
|
||||
echo "Starting container..."
|
||||
bash ./start.sh $1 || _die "Failed to start container ${CONTAINER_NAME}"
|
||||
|
||||
echo "Installation complete for service ${CONTAINER_NAME}."
|
Reference in New Issue
Block a user