47 lines
1 KiB
Bash
Executable file
47 lines
1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
IMAGE="git.interhacker.space/interhack/camp-website-2026:latest"
|
|
REGISTRY="git.interhacker.space"
|
|
|
|
need_cmd() {
|
|
command -v "$1" >/dev/null 2>&1 || {
|
|
echo "Missing required command: $1" >&2
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
need_cmd bash
|
|
need_cmd wget
|
|
need_cmd pandoc
|
|
need_cmd docker
|
|
|
|
if [[ ! -x ./update-guide.sh ]]; then
|
|
echo "Missing or non-executable ./update-guide.sh" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "==> Generating guide.html"
|
|
bash ./update-guide.sh
|
|
|
|
trap 'rm -f dist.zip' EXIT
|
|
|
|
echo "==> Downloading map bundle"
|
|
wget -q -O dist.zip https://git.interhacker.space/epickiwi/2026.camp.carte/releases/download/latest/dist.zip
|
|
|
|
echo "==> Logging in to ${REGISTRY}"
|
|
if [[ -n "${DOCKER_USERNAME:-}" && -n "${DOCKER_PASSWORD:-}" ]]; then
|
|
printf '%s' "$DOCKER_PASSWORD" | docker login "$REGISTRY" --username "$DOCKER_USERNAME" --password-stdin
|
|
else
|
|
docker login "$REGISTRY"
|
|
fi
|
|
|
|
echo "==> Building image: ${IMAGE}"
|
|
docker build --no-cache -t "$IMAGE" .
|
|
|
|
echo "==> Pushing image: ${IMAGE}"
|
|
docker push "$IMAGE"
|
|
|
|
rm -f dist.zip
|
|
|
|
echo "Done."
|