Building pi and debian images using branch by default, allowing specifying branch with -b option.
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled

This commit is contained in:
Roland 2026-02-22 15:09:15 -07:00
parent 71f20d8c59
commit c6393437af
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
6 changed files with 51 additions and 5 deletions

View file

@ -10,4 +10,5 @@ See https://live-team.pages.debian.net/live-manual/html/live-manual/index.en.htm
* `docker run --rm -v /home/user/district-of-columbia-230111.osm.pbf:/data/region.osm.pbf lrnselfreliance/osm-map-dumper > debian-live-config/config/includes.chroot/opt/wrolpi-blobs/map-db-gis.dump`
2. Run the build.
* `sudo ./build.sh`
* Or, build specific branch: `sudo ./build.sh -b master`
3. The ISO is now in the `debian-live-config` directory.

View file

@ -6,6 +6,25 @@ BUILD_DIR=/var/tmp/wrolpi-build-debian
VERSION=$(cat "${SCRIPT_DIR}/../wrolpi/version.txt")
Help() {
echo "Build WROLPi Debian Live ISO image."
echo
echo "Syntax: build.sh [-h] [-b BRANCH]"
echo "options:"
echo "h Print this help."
echo "b Build from this git BRANCH (default: 'release')."
echo
}
BRANCH="release"
while getopts ":hb:" option; do
case $option in
h) Help; exit ;;
b) BRANCH="${OPTARG}" ;;
*) echo "Error: Invalid option"; exit 1 ;;
esac
done
# Re-execute this script if it wasn't called with sudo.
if [ $EUID != 0 ]; then
sudo "$0" "$@"
@ -78,6 +97,9 @@ lb config \
rsync -a "${SCRIPT_DIR}/config" "${BUILD_DIR}/"
# Write branch config for hook script.
echo "${BRANCH}" > "${BUILD_DIR}/config/includes.chroot/opt/wrolpi-branch"
time nice -n 18 lb build 2>&1 | tee "${SCRIPT_DIR}/build.log"
grep "9999-wrolpi.hook.chroot completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "build hook failed!" && exit 1)

View file

@ -18,7 +18,10 @@ EOF
git --version
git clone -b master https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi
WROLPI_BRANCH="release"
[ -f /opt/wrolpi-branch ] && WROLPI_BRANCH=$(cat /opt/wrolpi-branch)
git clone -b "${WROLPI_BRANCH}" https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi
rm -f /opt/wrolpi-branch
# Install webapp.
cd /opt/wrolpi/app

View file

@ -19,12 +19,12 @@ See https://github.com/RPI-Distro/pi-gen
2. Run the build (or, with a specific git branch)
* Build master branch
* Build release branch (default)
sudo ./build.sh
* Build specific branch
sudo ./build.sh -b release-candidate
sudo ./build.sh -b master
3. The images are now in the `pi-gen` directory.

View file

@ -6,6 +6,25 @@ BUILD_DIR=/var/tmp/wrolpi-build-pi-gen
VERSION=$(cat "${SCRIPT_DIR}/../wrolpi/version.txt")
Help() {
echo "Build WROLPi Raspberry Pi OS image."
echo
echo "Syntax: build.sh [-h] [-b BRANCH]"
echo "options:"
echo "h Print this help."
echo "b Build from this git BRANCH (default: 'release')."
echo
}
BRANCH="release"
while getopts ":hb:" option; do
case $option in
h) Help; exit ;;
b) BRANCH="${OPTARG}" ;;
*) echo "Error: Invalid option"; exit 1 ;;
esac
done
# Re-execute this script if it wasn't called with sudo.
if [ $EUID != 0 ]; then
sudo "$0" "$@"
@ -81,6 +100,7 @@ mv /var/tmp/pi-gen-bookworm-arm64 /var/tmp/wrolpi-build-pi-gen
# Copy the configuration and build files into the pi-gen directory.
cp "${SCRIPT_DIR}/config.txt" "${BUILD_DIR}/config.txt"
echo "WROLPI_BRANCH=${BRANCH}" >> "${BUILD_DIR}/config.txt"
rsync -a "${SCRIPT_DIR}"/stage2/* "${BUILD_DIR}/stage2/"
# We only need to build the Lite and Desktop images.

View file

@ -35,8 +35,8 @@ chmod +x /usr/local/bin/deno
rm /tmp/deno.zip
deno --version
# Put the latest WROLPi master in /opt/wrolpi.
git clone -b master https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi
# Put the latest WROLPi in /opt/wrolpi.
git clone -b "${WROLPI_BRANCH:-release}" https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi
git config --global --add safe.directory /opt/wrolpi
# Install Python requirements. Try multiple times because pypi may stop responding.