diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..770e6d1 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +BUILDER_HOST= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6a0d56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +dist/ diff --git a/iso/builder/setup-builder.sh b/iso/builder/setup-builder.sh index 16bfa25..b525cf1 100644 --- a/iso/builder/setup-builder.sh +++ b/iso/builder/setup-builder.sh @@ -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 \ diff --git a/scripts/run-builder.sh b/scripts/run-builder.sh new file mode 100755 index 0000000..31c69ba --- /dev/null +++ b/scripts/run-builder.sh @@ -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 <