Files
chess/deploy/push-package.sh
Josh c72907e5b1
All checks were successful
Python tests (make) / test (push) Successful in 12s
Add pipeline helper scripts
Created a python script to bundle the application and some bash
scripts to pull and push packages from the registry.
2025-08-26 15:50:45 -04:00

33 lines
923 B
Bash
Executable File

#!/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