#!/bin/bash # Deploy billing API on s1 in Docker, then smoke-test the endpoints. set -e cd /tmp/billing_api echo "=== 1. Generate .env from admin-openrc.sh ===" . /etc/kolla/admin-openrc.sh cat > .env <&1 | tail -2 echo echo "=== 3. (Re)start container ===" docker rm -f billing_api 2>/dev/null || true docker run -d --name billing_api --restart unless-stopped \ --network host --env-file .env connectvm-billing-api sleep 8 docker ps --format '{{.Names}}\t{{.Status}}' | grep billing_api echo echo "=== 4. Smoke tests ===" echo "--- /health ---" curl -s http://127.0.0.1:8080/health echo echo "--- /api/v1/billing/summary (first 25 lines) ---" curl -s http://127.0.0.1:8080/api/v1/billing/summary | python3 -m json.tool | head -25 echo echo "--- /api/v1/billing/tenants/admin ---" curl -s http://127.0.0.1:8080/api/v1/billing/tenants/admin | python3 -m json.tool | head -40