veza/scripts/bootstrap/runner-bake-deps.sh
senke 6bd5d33e71 fix(deploy): pre-bake runner OS deps + skip devDeps to dodge iltorb
The dpkg-lock thrashing — even with flock — was unwinnable: an unrelated
apt-get had been holding the host lock for >180s. Stop installing OS
packages from inside the workflow entirely; assume they're baked onto the
forgejo-runner container, fail loudly with a clear pointer if they're
missing.

scripts/bootstrap/runner-bake-deps.sh installs them all in one shot.

While here, fix the iltorb regression: --include=dev was dragging in
apps/web's bundlesize devDep, which transitively pulls iltorb (a
deprecated native node-gyp module that doesn't build on Node 20).
Moved style-dictionary to dependencies in @veza/design-system (it's a
build tool, needed by `npm run build:tokens` at deploy time, not a dev
tool), and the workflow now runs plain `npm ci` with NODE_ENV=production.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 10:43:28 +02:00

47 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# Install the OS packages every deploy.yml job assumes are pre-baked
# on the forgejo-runner Incus container. Run once per runner; idempotent.
#
# Usage (from operator laptop):
# ssh -t srv-102v 'sudo bash -s' < scripts/bootstrap/runner-bake-deps.sh
#
# Or run directly on the R720:
# sudo bash scripts/bootstrap/runner-bake-deps.sh
set -euo pipefail
PKGS=(
# tarball compression for build artifacts
zstd
# rust musl-static target
musl-tools
# rust openssl-sys build-time
pkg-config
libssl-dev
# ansible + postgres lib for community.postgresql modules
ansible
python3-psycopg2
python3-pip
# native node modules (mostly belt-and-braces — current deploy
# avoids them via NODE_ENV=production, but keep for safety)
build-essential
python3-dev
)
echo "→ baking deps onto forgejo-runner container"
incus exec forgejo-runner -- bash -c "
set -euo pipefail
DEBIAN_FRONTEND=noninteractive apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ${PKGS[*]}
"
echo
echo "→ verifying"
incus exec forgejo-runner -- bash -c '
for cmd in zstd musl-gcc pkg-config ansible-playbook python3; do
printf " %-20s " "$cmd:"
command -v "$cmd" || { echo MISSING ; exit 1 ; }
done
'
echo
echo "✓ runner deps baked. Re-run Veza deploy in Forgejo UI."