22 lines
547 B
Bash
Executable File
22 lines
547 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Load config if present else use environment.
|
|
CONFIG_FILE="$(dirname "$0")/local.env"
|
|
if [ -f "$CONFIG_FILE" ]; then
|
|
source "$CONFIG_FILE"
|
|
fi
|
|
|
|
|
|
VERSION=$(date +%Y%m%d-%H%M%S)
|
|
|
|
OUTFILE="app-bundle-${VERSION}.zip"
|
|
|
|
echo "[*] Building $OUTFILE..."
|
|
git archive --format=zip HEAD -o "$OUTFILE"
|
|
|
|
echo "[*] Pushing to registry as $VERSION..."
|
|
curl -f -u "${REGISTRY_USER}:${REGISTRY_TOKEN}" \
|
|
--upload-file "$OUTFILE" \
|
|
"${REGISTRY_URL}/api/packages/projects/generic/chess/${VERSION}/$(basename "$OUTFILE")"
|