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>
This commit is contained in:
29
deploy/pull-package.sh
Executable file
29
deploy/pull-package.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/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}"
|
||||
Reference in New Issue
Block a user