fix new-app: retry build trigger, clean up temp nginx conf, add remove-app script

This commit is contained in:
2026-03-16 21:07:34 -04:00
parent e86b7bc58f
commit 7df77db7b3
3 changed files with 94 additions and 5 deletions
+11 -5
View File
@@ -276,11 +276,17 @@ git push
# --- Trigger initial build ---
echo "==> Triggering initial build for $APP..."
TRIGGER_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP/contents/.deploy-trigger" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\": \"$(echo -n "initial deploy" | base64)\", \"message\": \"trigger initial build\"}")
# Wait for template repo to be ready (Gitea generates content asynchronously)
for i in $(seq 1 60); do
TRIGGER_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP/contents/.deploy-trigger" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\": \"$(echo -n "initial deploy" | base64)\", \"message\": \"trigger initial build\"}")
[ "$TRIGGER_CODE" != "404" ] && break
echo " Waiting for repo to be ready..."
sleep 2
done
if [ "$TRIGGER_CODE" = "201" ]; then
echo " Build triggered."