fix new-app: retry build trigger, clean up temp nginx conf, add remove-app script
This commit is contained in:
+11
-5
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user