Dropshell basic templates (WIP)
This commit is contained in:
23
example-nginx/install.sh
Normal file
23
example-nginx/install.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/_common.sh"
|
||||
_check_required_env_vars "LOCAL_DATA_FOLDER" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG" "CONTAINER_NAME"
|
||||
|
||||
# Nginx Example Install Script
|
||||
|
||||
# Ensure local data folder exists
|
||||
autocreate "path=${LOCAL_DATA_FOLDER}"
|
||||
|
||||
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..."
|
||||
bash ./stop.sh || _die "Failed to stop container ${CONTAINER_NAME}"
|
||||
_remove_container $CONTAINER_NAME || _die "Failed to remove container ${CONTAINER_NAME}"
|
||||
|
||||
echo "Starting container..."
|
||||
bash ./start.sh || _die "Failed to start container ${CONTAINER_NAME}"
|
||||
|
||||
echo "Installation complete for service ${CONTAINER_NAME}."
|
Reference in New Issue
Block a user