Files
chess/deploy/pull-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

30 lines
670 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CONFIG_FILE="$(dirname "$0")/local.env"
if [ -f "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
fi
VERSION="${VERSION:-${1:-latest}}"
if [ -z "$VERSION" ]; then
echo "Usage: $0 <version>"
echo "Or set VERSION env var."
exit 1
fi
OUTDIR="${DOWNLOAD_DIR:-downloads}"
mkdir -p "$OUTDIR"
FILENAME="${VERSION}.chess.zip"
URL="${REGISTRY_URL}/api/packages/projects/generic/chess/${VERSION}/chess.zip"
echo "${URL}"
echo "[*] Pulling package $FILENAME (version: $VERSION) from registry..."
curl -f -u "${REGISTRY_USER}:${REGISTRY_TOKEN}" \
-o "${OUTDIR}/${FILENAME}" \
"$URL"
echo "[+] Downloaded to ${OUTDIR}/${FILENAME}"