From 4b9fe0b05bd138cebd825e67cb6c5a062181d6d8 Mon Sep 17 00:00:00 2001 From: Arcitec <38923130+Arcitec@users.noreply.github.com> Date: Tue, 9 May 2023 15:26:26 +0200 Subject: [PATCH] fix: add flags to ensure that build aborts if there are errors --- build.sh | 4 ++++ scripts/example.sh | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/build.sh b/build.sh index 592602ac89..a0eec00612 100644 --- a/build.sh +++ b/build.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# Tell build process to exit if there are any errors. +set -ouex pipefail + # run scripts echo "-- Running scripts defined in recipe.yml --" buildscripts=$(yq '.scripts[]' < /usr/etc/ublue-recipe.yml) diff --git a/scripts/example.sh b/scripts/example.sh index 3c7d709559..1487103f81 100644 --- a/scripts/example.sh +++ b/scripts/example.sh @@ -1,3 +1,10 @@ #!/bin/bash + +# Tell this script to exit if there are any errors. +# You should have this in every custom script, to ensure that your completed +# builds actually ran successfully without any errors! +set -ouex pipefail + +# Your code goes here. echo 'This is an example shell script' echo 'Scripts here will run during build if specified in recipe.yml'