From 72552a7a20f1d624332906c84547ea3913103e6b Mon Sep 17 00:00:00 2001 From: Mark Feit Date: Thu, 5 Oct 2023 16:02:25 +0000 Subject: [PATCH] Add BUILD_NO_AUTO feature --- prep/container/build | 11 +++++++++++ prep/container/build.service | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/prep/container/build b/prep/container/build index 3996f13..43e30f5 100755 --- a/prep/container/build +++ b/prep/container/build @@ -20,6 +20,17 @@ die() } +# If we've been told not to do anything, just bail out. This is for +# use in GitHub actions so there's a container with systemd running +# where the build is handled in its steps instead of automatically. + +if [ -n "${BUILD_NO_AUTO}" ] +then + echo "NO_AUTO set. Not building anything and not halting system." + exit 0 +fi + + # Halt the system on exit unless we're interactive, in which case # we're debugging. diff --git a/prep/container/build.service b/prep/container/build.service index ad7247d..099d29c 100644 --- a/prep/container/build.service +++ b/prep/container/build.service @@ -5,7 +5,7 @@ After=multi-user.target [Service] Type=exec -PassEnvironment=BUILD_NO_HALT +PassEnvironment=BUILD_NO_AUTO BUILD_NO_HALT ExecStart=/usr/bin/build StandardInput=tty-force