🏡 index : cold-air-networks/chromium-setup.git

#!/usr/bin/env bash
# Install-build-deps phase: run via `hetzner-runner exec -script install-deps.sh`
# against a box already synced by sync.sh in an earlier step.
set -euo pipefail

: "${CHROMIUM_ROOT:=/root/chromium-ci}"
export PATH="$HOME/depot_tools:$PATH"

retry() {
  local desc="$1"; shift
  local attempt=1
  local max=5
  until "$@"; do
    if [ "$attempt" -ge "$max" ]; then
      echo "$desc failed after $attempt attempts, giving up"
      return 1
    fi
    echo "$desc failed (attempt $attempt/$max); retrying in 5s"
    attempt=$((attempt + 1))
    sleep 5
  done
}

# Already root on this box -- no sudo/no_new_privs wrinkle to work around.
retry "install-build-deps" "$CHROMIUM_ROOT/src/build/install-build-deps.py" --no-prompt