From 1809c04b7499a188d1c2a7df3ec588bc8591a2e3 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 6 Dec 2013 13:04:58 -0500 Subject: [PATCH] new function, and better approach for error handling. --- scripts/buildor/build_xsedes.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/buildor/build_xsedes.sh b/scripts/buildor/build_xsedes.sh index f51a0375..659965ec 100644 --- a/scripts/buildor/build_xsedes.sh +++ b/scripts/buildor/build_xsedes.sh @@ -2,6 +2,9 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" +#hmmm: if this works well, we can use it in lots of places. +alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred. $msg"; return 1; fi' + function build_xsede() { if [ -z "$GENII_INSTALL_DIR" ]; then @@ -46,10 +49,22 @@ function rebuild_xsede() function rebu_bootstrap() { rebuild_xsede - check_result "failed to rebuild xsede code" + if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh - check_result "failed to bootstrap a container" + if [ $? -ne 0 ]; then echo "failed to bootstrap a container"; return 1; fi + + success_sound +} + +# a shortcut for doing a quick build and then creating an installer. +function fast_install_build() +{ + build_xsede + if [ $? -ne 0 ]; then echo "failed to build xsede code"; return 1; fi + + bash $GENII_INSTALL_DIR/xsede_tools/tools/installer/fast_installer_build.sh $* + if [ $? -ne 0 ]; then echo "failed to create the installer."; return 1; fi success_sound } -- 2.34.1