fix: include UNRAID_COMPOSE_DIR in variable requirements and update paths in phase1_teardown.sh

This commit is contained in:
S
2026-03-02 11:42:56 -05:00
parent 8e2bc35781
commit efff379b80

View File

@@ -45,9 +45,10 @@ confirm_action() {
} }
load_env load_env
require_vars UNRAID_IP UNRAID_SSH_USER UNRAID_GITEA_DATA_PATH require_vars UNRAID_IP UNRAID_SSH_USER UNRAID_GITEA_DATA_PATH UNRAID_COMPOSE_DIR
DATA_PATH="$UNRAID_GITEA_DATA_PATH" DATA_PATH="$UNRAID_GITEA_DATA_PATH"
COMPOSE_DIR="${UNRAID_COMPOSE_DIR}/gitea"
log_warn "=== Phase 1 Teardown: Gitea on Unraid ===" log_warn "=== Phase 1 Teardown: Gitea on Unraid ==="
@@ -58,10 +59,10 @@ TEARDOWN_FAILED=false
# Step 1: Stop and remove the Gitea container # Step 1: Stop and remove the Gitea container
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Check if docker-compose file exists (skip if already torn down) # Check if docker-compose file exists (skip if already torn down)
if ssh_exec UNRAID "test -f '${DATA_PATH}/docker-compose.yml'" 2>/dev/null; then if ssh_exec UNRAID "test -f '${COMPOSE_DIR}/docker-compose.yml'" 2>/dev/null; then
if confirm_action 'This will stop Gitea on Unraid. Continue? [y/N] '; then if confirm_action 'This will stop Gitea on Unraid. Continue? [y/N] '; then
# Try modern "docker compose" first, fall back to standalone # Try modern "docker compose" first, fall back to standalone
if ssh_exec UNRAID "cd '${DATA_PATH}' && docker compose down 2>/dev/null || docker-compose down"; then if ssh_exec UNRAID "cd '${COMPOSE_DIR}' && docker compose down 2>/dev/null || docker-compose down"; then
log_success "Gitea container stopped and removed" log_success "Gitea container stopped and removed"
else else
log_error "Failed to stop/remove Gitea container via docker-compose" log_error "Failed to stop/remove Gitea container via docker-compose"