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:
1
.env.example
Normal file
1
.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
BUILDER_HOST=
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.env
|
||||||
|
dist/
|
||||||
@@ -19,6 +19,10 @@ echo "Go target: ${GO_VERSION}"
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# --- system packages ---
|
# --- system packages ---
|
||||||
|
apk update
|
||||||
|
# enable community repo if not already enabled
|
||||||
|
sed -i 's|^#\(.*community\)|\1|' /etc/apk/repositories
|
||||||
|
|
||||||
apk update
|
apk update
|
||||||
apk add \
|
apk add \
|
||||||
alpine-sdk \
|
alpine-sdk \
|
||||||
|
|||||||
57
scripts/run-builder.sh
Executable file
57
scripts/run-builder.sh
Executable 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/"
|
||||||
Reference in New Issue
Block a user