#!/usr/bin/env bash # BuildBot master installer - RUN ON 192.168.3.110 as root. # Budget: 512MB RAM / 3GB disk (lean: sqlite, no extras beyond base plugins). set -euo pipefail DEST=${DEST:-/opt/kukuri-buildbot} PY=${PY:-python3} "$PY" -m venv "$DEST/venv" "$DEST/venv/bin/pip" install --upgrade pip >/dev/null "$DEST/venv/bin/pip" install buildbot "buildbot-www" "buildbot-waterfall-view" "buildbot-console-view" "buildbot-grid-view" mkdir -p "$DEST" cp master.cfg "$DEST/master.cfg" if [ ! -f /etc/kukuri-buildbot.env ]; then read -rp "git password for ketsuban: " GPASS WPASS=$(openssl rand -hex 12) # Write git credentials file so the URL doesn't embed a password HOME="$DEST" git config --global credential.helper store cat > "$DEST/.git-credentials" << EOF http://ketsuban:$GPASS@192.168.3.110 EOF chmod 600 "$DEST/.git-credentials" cat > /etc/kukuri-buildbot.env << EOF WORKER_PASS=$WPASS EOF chmod 600 /etc/kukuri-buildbot.env echo "" echo "===============================================================" echo "Put this WORKER_PASS on the builder host:" echo " mkdir -p /root/buildbot/secrets" echo " echo -n '$WPASS' > /root/buildbot/secrets/worker_pass" echo "===============================================================" fi cp kukuri-buildbot.service /etc/systemd/system/ systemctl daemon-reload systemctl enable --now kukuri-buildbot sleep 3 systemctl --no-pager status kukuri-buildbot | head -5 || true echo "Web UI: http://192.168.3.110:8010/"