Add pipeline helper scripts
All checks were successful
Python tests (make) / test (push) Successful in 12s

Created a python script to bundle the application and some bash
scripts to pull and push packages from the registry.
This commit is contained in:
2025-08-26 15:50:45 -04:00
parent 6de4f4844e
commit c72907e5b1
5 changed files with 129 additions and 21 deletions

32
deploy/push-package.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Load config if present else use environment.
CONFIG_FILE="$(dirname "$0")/local.env"
if [ -f "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
fi
# Latest package.
OUTFILE=$(ls -1t ./deploy/package/* | head -n1 || true)
FILENAME="$(basename "$OUTFILE")"
VERSION="${FILENAME%%.*}"
echo "[*] Pushing ${VERSION} to registry."
curl -f -u "${REGISTRY_USER}:${REGISTRY_TOKEN}" \
--upload-file "$OUTFILE" \
"${REGISTRY_URL}/api/packages/projects/generic/chess/${VERSION}/chess.zip"
echo "[*] Deleting ${VERSION} latest to overwrite."
curl -f -u "${REGISTRY_USER}:${REGISTRY_TOKEN}" \
-X DELETE \
"${REGISTRY_URL}/api/packages/projects/generic/chess/latest/chess.zip" || true
echo "[*] Pushing ${VERSION} as latest to registry."
curl -f -u "${REGISTRY_USER}:${REGISTRY_TOKEN}" \
--upload-file "$OUTFILE" \
"${REGISTRY_URL}/api/packages/projects/generic/chess/latest/chess.zip" || true