From 6956749570a64800b63655539dc9ef07d76dce32 Mon Sep 17 00:00:00 2001
From: Thomas Juerges <4-jurges@users.noreply.git.astron.nl>
Date: Tue, 18 May 2021 17:27:57 +0200
Subject: [PATCH] L2SS-218 Disable exit on error in clean_images

This allows make to return with a non-0 code which in turn does
not force Bash to exit.  This happens when the containers where
already down and/or the volumes cleaned up.
---
 bootstrap/sbin/rebuild_system_from_scratch.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bootstrap/sbin/rebuild_system_from_scratch.sh b/bootstrap/sbin/rebuild_system_from_scratch.sh
index 9d5502ef1..dcbd54cb6 100755
--- a/bootstrap/sbin/rebuild_system_from_scratch.sh
+++ b/bootstrap/sbin/rebuild_system_from_scratch.sh
@@ -48,8 +48,14 @@ function stop_images()
 
 function clean_images()
 {
+    # This can return a non-0 return code if the system
+    # has already been shut down.
+    # Therefore disable Bash's exit on error flag
+    set +e
     pushd ${HOME_DIR}/docker-compose && make clean
     popd
+    # And enable it again.
+    set -e
 }
 
 function start_minimal_tango()
-- 
GitLab