feat(ci): Add package linking to repository
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Link all Docker container packages to the mosaic/stack repository
using Gitea's package API. This makes packages visible on the
repository page and shows which repo they came from.
API endpoint: /packages/{owner}/container/{name}/-/link/{repo_name}
Links created for:
- mosaic/api
- mosaic/web
- mosaic/postgres
- mosaic/openbao
- mosaic/orchestrator
Each package will now show up in the repository's packages tab.
This commit is contained in:
@@ -264,3 +264,34 @@ steps:
|
||||
event: [push, manual, tag]
|
||||
depends_on:
|
||||
- build
|
||||
|
||||
# ======================
|
||||
# Link Packages to Repository
|
||||
# ======================
|
||||
# Links all Docker packages to the mosaic/stack repository
|
||||
# This makes packages visible on the repository page in Gitea
|
||||
link-packages:
|
||||
image: alpine:latest
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
commands:
|
||||
- apk add --no-cache curl
|
||||
- |
|
||||
# Link all container packages to the repository
|
||||
for package in api web postgres openbao orchestrator; do
|
||||
echo "Linking package mosaic/${package} to repository stack..."
|
||||
curl -X PUT \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://git.mosaicstack.dev/api/v1/packages/mosaic/container/${package}/-/link/stack" || echo "Failed to link ${package} (may not exist yet)"
|
||||
done
|
||||
when:
|
||||
- branch: [main, develop]
|
||||
event: [push, manual, tag]
|
||||
depends_on:
|
||||
- docker-build-api
|
||||
- docker-build-web
|
||||
- docker-build-postgres
|
||||
- docker-build-openbao
|
||||
- docker-build-orchestrator
|
||||
|
||||
Reference in New Issue
Block a user