Files
chess/deploy/push-package.sh
Josh 5f3d54f3d7
Some checks failed
Python tests (make) / test (push) Successful in 11s
Build & Push Package / package-and-push (push) Failing after 3s
34-create-package-process (#35)
works on #34

Reviewed-on: #35
Co-authored-by: Josh <josh@joshuaschuett.com>
Co-committed-by: Josh <josh@joshuaschuett.com>
2025-08-26 20:02:48 +00: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