webhook creation should be added
This commit is contained in:
@@ -112,6 +112,27 @@ curl -sS -X POST "$GITEA_URL/api/v1/orgs/$GITEA_ORG/repos" \
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
if [[ "$GITEA_URL" == http://* ]]; then
|
if [[ "$GITEA_URL" == http://* ]]; then
|
||||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||||
elif [[ "$GITEA_URL" == https://* ]]; then
|
elif [[ "$GITEA_URL" == https://* ]]; then
|
||||||
|
|||||||
@@ -162,6 +162,27 @@ curl -sS -X POST "$GITEA_URL/api/v1/orgs/$GITEA_ORG/repos" \
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
if [[ "$GITEA_URL" == http://* ]]; then
|
if [[ "$GITEA_URL" == http://* ]]; then
|
||||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||||
elif [[ "$GITEA_URL" == https://* ]]; then
|
elif [[ "$GITEA_URL" == https://* ]]; then
|
||||||
|
|||||||
@@ -133,6 +133,27 @@ curl -sS -X POST "$GITEA_URL/api/v1/orgs/$GITEA_ORG/repos" \
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
if [[ "$GITEA_URL" == http://* ]]; then
|
if [[ "$GITEA_URL" == http://* ]]; then
|
||||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||||
elif [[ "$GITEA_URL" == https://* ]]; then
|
elif [[ "$GITEA_URL" == https://* ]]; then
|
||||||
|
|||||||
@@ -88,6 +88,27 @@ curl -sS -X POST "$GITEA_URL/api/v1/orgs/$GITEA_ORG/repos" \
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
if [[ "$GITEA_URL" == http://* ]]; then
|
if [[ "$GITEA_URL" == http://* ]]; then
|
||||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||||
elif [[ "$GITEA_URL" == https://* ]]; then
|
elif [[ "$GITEA_URL" == https://* ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user