add run-builder.sh, .env, .gitignore; fix community repo in setup-builder.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 11:27:26 +03:00
parent 65d92d59c2
commit 45f3182470
4 changed files with 64 additions and 0 deletions

1
.env.example Normal file
View File

@@ -0,0 +1 @@
BUILDER_HOST=

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.env
dist/

View File

@@ -19,6 +19,10 @@ echo "Go target: ${GO_VERSION}"
echo ""
# --- system packages ---
apk update
# enable community repo if not already enabled
sed -i 's|^#\(.*community\)|\1|' /etc/apk/repositories
apk update
apk add \
alpine-sdk \

57
scripts/run-builder.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/sh
# run-builder.sh — trigger debug ISO build on remote Alpine builder VM
#
# Usage:
# sh scripts/run-builder.sh
# sh scripts/run-builder.sh --authorized-keys /path/to/authorized_keys
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
# load .env
ENV_FILE="${REPO_ROOT}/.env"
if [ -f "$ENV_FILE" ]; then
# shellcheck disable=SC1090
. "$ENV_FILE"
fi
BUILDER_HOST="${BUILDER_HOST:-}"
if [ -z "$BUILDER_HOST" ]; then
echo "ERROR: BUILDER_HOST not set. Copy .env.example to .env and set the address."
exit 1
fi
EXTRA_ARGS=""
while [ $# -gt 0 ]; do
case "$1" in
--authorized-keys) EXTRA_ARGS="--authorized-keys $2"; shift 2 ;;
*) echo "unknown arg: $1"; exit 1 ;;
esac
done
echo "=== bee builder ==="
echo "Builder: ${BUILDER_HOST}"
echo ""
ssh -o StrictHostKeyChecking=no root@"${BUILDER_HOST}" /bin/sh <<EOF
set -e
REPO=/root/bee
if [ ! -d "\$REPO/.git" ]; then
echo "--- cloning bee repo ---"
git clone https://git.mchus.pro/reanimator/bee.git "\$REPO"
fi
cd "\$REPO"
echo "--- pulling latest ---"
git pull --ff-only
echo "--- running build ---"
sh iso/builder/build-debug.sh ${EXTRA_ARGS}
EOF
echo ""
echo "=== build complete ==="
echo "Fetch the ISO from ${BUILDER_HOST}:/root/bee/dist/"