diff --git a/.github/workflows/cblock.yml b/.github/workflows/cblock.yml index 76d14d1..fae21a7 100644 --- a/.github/workflows/cblock.yml +++ b/.github/workflows/cblock.yml @@ -8,7 +8,7 @@ # vars.CBLOCK_SSH_USER ssh user on vmcall (default: ci); it # must be in the cblock group # -name: cblock +name: freebsd on: push: @@ -71,11 +71,16 @@ jobs: EOF - name: Check the connection to cblockd - run: cblock instances + run: | + set -o pipefail + cblock instances | awk 'NR == 1 || /forge/' - name: Build the Cblockfile run: cblock build -n cblocks-ci -t "${GITHUB_SHA::12}" . + - name: Remove the image + run: cblock images --remove "cblocks-ci:${GITHUB_SHA::12}" + - name: Close the ssh connection if: always() run: ssh -O exit vmcall.sqrt.ca || true diff --git a/examples/README.md b/examples/README.md index fb0a7f7..28283ba 100644 --- a/examples/README.md +++ b/examples/README.md @@ -5,3 +5,4 @@ | base | Example creating a base image from the distfiles on FreeBSD's site | | builder | Example creating a build for compilation of C/C++ projects | | h2o | Multi-stage build example where we copy build artifacts from one stage to another | +| fbsd-lite | Minimal FreeBSD 15-STABLE image built from source with its own `src.conf` | diff --git a/src/shell/stage_launch_cleanup.sh b/src/shell/stage_launch_cleanup.sh index 4f3b972..8c03b50 100644 --- a/src/shell/stage_launch_cleanup.sh +++ b/src/shell/stage_launch_cleanup.sh @@ -68,7 +68,12 @@ network_cleanup() umount_reverse_order() { - for fs in $(mount -p | awk '{ print $2 }' | grep -F "${instance}" | tail -r); do + # + # Match on the instance directory, not the bare instance id: images + # are committed as . and would match too. + # + for fs in $(mount -p | awk -v p="${data_root}/instances/${instance}/" \ + 'index($2 "/", p) == 1 { print $2 }' | tail -r); do umount -f "$fs" done }