docs: Add 1 and update 13 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 49s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 49s
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
# UNINSTALL SCRIPT
|
||||
# The uninstall script is required for all templates.
|
||||
# It is used to uninstall the service from the server.
|
||||
# IMPORTANT: This script MUST preserve data volumes!
|
||||
# Export variables for docker compose
|
||||
export CONTAINER_NAME DATA_PATH HTTP_PORT PUID PGID TZ IMAGE_TAG DB_NAME DB_USER DB_PASS
|
||||
|
||||
_remove_container "$CONTAINER_NAME" || _die "Failed to remove container ${CONTAINER_NAME}"
|
||||
_is_container_running "$CONTAINER_NAME" && _die "Couldn't stop existing container"
|
||||
_is_container_exists "$CONTAINER_NAME" && _die "Couldn't remove existing container"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
# Remove the image
|
||||
docker rmi "$IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG" || echo "Failed to remove image $IMAGE_REGISTRY/$IMAGE_REPO:$IMAGE_TAG"
|
||||
# Stop and remove containers (but preserve volumes/data)
|
||||
docker compose down || _die "Failed to stop containers"
|
||||
|
||||
# Remove images
|
||||
docker compose config --images | xargs -r docker rmi 2>/dev/null || true
|
||||
|
||||
echo "Uninstallation of ${CONTAINER_NAME} complete."
|
||||
echo "Data volume preserved. To remove all data, use destroy.sh"
|
||||
echo "Data preserved in ${DATA_PATH}. To remove all data, use destroy.sh"
|
||||
|
||||
Reference in New Issue
Block a user