#!/usr/bin/env bash
set -euo pipefail

active=none
[[ -f /etc/harbor/active-slot ]] && active=$(cat /etc/harbor/active-slot)
printf 'active_slot=%s\n' "$active"
printf 'current_release=%s\n' "$(readlink -f /opt/harbor/current 2>/dev/null || printf none)"
systemctl --no-pager --full status "harbor-gateway@$active.service" "harbor-worker@$active.service" 2>/dev/null || true
docker compose --env-file /etc/harbor/harbor.env -f /opt/harbor/deploy/compose/docker-compose.yml ps
curl -fsS http://127.0.0.1/health
printf '\n'
