-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·31 lines (26 loc) · 1.37 KB
/
bootstrap.sh
File metadata and controls
executable file
·31 lines (26 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# bootstrap.sh — Prepare a FreeBSD CI environment for dbuild.
#
# Installs python3, fetches dbuild, and runs ci-prepare (which installs
# podman, buildah, skopeo, trivy, ocijail, and configures networking).
#
# Default: fetched from GitHub by the CI workflow template.
# Override: place .daemonless/bootstrap.sh in your image repo.
#
# Environment:
# DBUILD_REF - dbuild version to fetch (default: v2)
# DBUILD_DIR - install location (default: /tmp/dbuild)
set -e
DBUILD_REF="${DBUILD_REF:-v2}"
DBUILD_DIR="${DBUILD_DIR:-/tmp/dbuild}"
# ── Install python3 + PyYAML (minimum to run dbuild) ────────────────
mkdir -p /etc/pkg
echo 'FreeBSD: { url: "http://pkg.FreeBSD.org/${ABI}/latest" }' > /etc/pkg/FreeBSD.conf
pkg update -f && pkg install -y python3 py311-yaml
# ── Fetch dbuild ────────────────────────────────────────────────────
fetch -qo /tmp/dbuild.tar.gz \
"https://github.com/daemonless/dbuild/archive/${DBUILD_REF}.tar.gz"
mkdir -p "$DBUILD_DIR"
tar -xzf /tmp/dbuild.tar.gz -C "$DBUILD_DIR" --strip-components=1
# ── Prepare build environment ───────────────────────────────────────
PYTHONPATH="$DBUILD_DIR" python3 -m dbuild ci-prepare