fix: include FEDORA_COMPOSE_DIR in variable requirements and update paths in phase2_teardown.sh

This commit is contained in:
S
2026-03-02 11:43:04 -05:00
parent 5ba53e11a3
commit e05124f6f1

View File

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