diff --git a/scripts/new-python-app.sh b/scripts/new-python-app.sh index 3cbf627..61c3b47 100755 --- a/scripts/new-python-app.sh +++ b/scripts/new-python-app.sh @@ -89,6 +89,27 @@ if grep -q '"message"' /tmp/appfactory-create-repo-response.json; then cat /tmp/appfactory-create-repo-response.json fi +echo "Creating Gitea webhook..." + +curl -sS -X POST \ + "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP_ID/hooks" \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{ + \"type\": \"gitea\", + \"active\": true, + \"events\": [\"push\"], + \"config\": { + \"url\": \"$WEBHOOK_INTERNAL_URL\", + \"content_type\": \"json\", + \"secret\": \"$WEBHOOK_SECRET\" + } + }" > /tmp/appfactory-create-hook-response.json + +if grep -q '"message"' /tmp/appfactory-create-hook-response.json; then + cat /tmp/appfactory-create-hook-response.json +fi + git init git branch -M main git remote add origin "$GITEA_URL/$GITEA_ORG/$APP_ID.git"