fix(ci): Handle 201 status code for package linking
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

The Gitea package link API returns 201 (Created) on successful linking,
not 204 (No Content) as we were checking for. Updated the link-packages
step to accept both 201 and 204 as success.

Also added visual indicators (/) to make link status clearer in logs.

Diagnostic output showed all 5 packages successfully linked with 201:
- stack-api: 201 (linked)
- stack-web: 201 (linked)
- stack-postgres: 201 (linked)
- stack-openbao: 201 (linked)
- stack-orchestrator: 201 (linked)

Subsequent runs return 400 "invalid argument" which means already linked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 14:46:48 -06:00
parent a61f9262e6
commit aad6cb75d0

View File

@@ -282,12 +282,12 @@ steps:
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
-H "Authorization: token $GITEA_TOKEN" \ -H "Authorization: token $GITEA_TOKEN" \
"https://git.mosaicstack.dev/api/v1/packages/mosaic/container/${package}/-/link/stack") "https://git.mosaicstack.dev/api/v1/packages/mosaic/container/${package}/-/link/stack")
if [ "$STATUS" = "204" ]; then if [ "$STATUS" = "201" ] || [ "$STATUS" = "204" ]; then
echo "Linked ${package} to stack" echo "Linked ${package} to stack"
elif [ "$STATUS" = "400" ]; then elif [ "$STATUS" = "400" ]; then
echo "${package} already linked (OK)" echo "${package} already linked (OK)"
else else
echo "Warning: ${package} link returned $STATUS" echo "Warning: ${package} link returned $STATUS"
fi fi
done done
when: when: