From e54809695cdefc58d7e7930d242ddf1baca92ffd Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 21 Aug 2026 01:55:12 +0000 Subject: [PATCH] Add deploy_on_s1.sh --- deploy_on_s1.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 deploy_on_s1.sh diff --git a/deploy_on_s1.sh b/deploy_on_s1.sh new file mode 100644 index 0000000..795736b --- /dev/null +++ b/deploy_on_s1.sh @@ -0,0 +1,41 @@ +#!/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