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:
32
deploy/push-package.sh
Executable file
32
deploy/push-package.sh
Executable 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
|
||||
Reference in New Issue
Block a user