diff options
author | dd <dd@wx.tnyzeq.icu> | 2024-06-30 17:06:26 +0200 |
---|---|---|
committer | dd <dd@wx.tnyzeq.icu> | 2024-06-30 17:06:26 +0200 |
commit | fbff50d477ace829335b9600a3b611256cf97d70 (patch) | |
tree | b1fa6e26c8ba259a5607508c48c7a4f2d65bcc43 /build-iso.sh | |
parent | 62765d042fe1b4a0131b67a6529401e01d0db0e0 (diff) | |
download | vyos-jenkins-fbff50d477ace829335b9600a3b611256cf97d70.tar.gz vyos-jenkins-fbff50d477ace829335b9600a3b611256cf97d70.zip |
updated scripts to use proper exit code and stderr for reporting errors
Diffstat (limited to 'build-iso.sh')
-rwxr-xr-x | build-iso.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/build-iso.sh b/build-iso.sh index c9a4598..dc6fd6e 100755 --- a/build-iso.sh +++ b/build-iso.sh @@ -22,8 +22,8 @@ read -p "Please enter your email address: " EMAIL echo if ([ "$BRANCH" != "equuleus" ] && [ "$BRANCH" != "sagitta" ]); then - echo -e "${RED}Invalid branch${NOCOLOR}" - exit + >&2 echo -e "${RED}Invalid branch${NOCOLOR}" + exit 1 fi if [ -d vyos-build ]; then @@ -166,13 +166,13 @@ elif [ "$BRANCH" == "sagitta" ]; then BUILD_EXIT_CODE=$? else - echo -e "${RED}Invalid branch${NOCOLOR}" - exit + >&2 echo -e "${RED}Invalid branch${NOCOLOR}" + exit 1 fi if [ $BUILD_EXIT_CODE != 0 ]; then - echo -e "${RED}ISO build failed${NOCOLOR}" - exit + >&2 echo -e "${RED}ISO build failed${NOCOLOR}" + exit 1 fi if [ -f vyos-build/build/live-image-amd64.hybrid.iso ]; then @@ -182,8 +182,8 @@ if [ -f vyos-build/build/live-image-amd64.hybrid.iso ]; then echo -e "The file is called: ${GREEN}vyos-${RELEASE_NAME}-iso-amd64.iso${NOCOLOR}". else echo - echo -e "${RED}Failed to locate ISO file.${NOCOLOR}" - exit + >&2 echo -e "${RED}Failed to locate ISO file.${NOCOLOR}" + exit 1 fi if [ -d vyos-build ]; then |