X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fbuildor%2Fbuild_xsedes.sh;h=a6a52e35ba57b2e0f6f6b3fde6b98375d9afa8eb;hb=b22f6c18085e3735f76ee6bddf3aed36f17638a8;hp=f51a037555106108f052ce48f25f6ba207b0c10f;hpb=22415d0725fa56857f3e7744a0cd1c741e2e9191;p=feisty_meow.git diff --git a/scripts/buildor/build_xsedes.sh b/scripts/buildor/build_xsedes.sh index f51a0375..a6a52e35 100644 --- a/scripts/buildor/build_xsedes.sh +++ b/scripts/buildor/build_xsedes.sh @@ -2,27 +2,31 @@ 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 echo GENII_INSTALL_DIR is not set. return 1 fi - pushd $GENII_INSTALL_DIR - if [ $? -ne 0 ]; then return 1; fi + pushd "$GENII_INSTALL_DIR" + if [ $? -ne 0 ]; then + error_sound + return 1 + fi echo "Build starting at: $(date)" -# clean up some things. -#maybe not needed. -if [ ! -d unit-test-reports ]; then -echo this chunk in build_xsedes could be removed to clean up unit tests -else -\rm -rf unit-test-reports -fi + # clean up some things. + \rm -rf unit-test-reports # build the trunk. ant -Dbuild.targetArch=64 build - if [ $? -ne 0 ]; then return 1; fi + if [ $? -ne 0 ]; then + error_sound + return 1 + fi echo "Build done at: $(date)" popd @@ -35,9 +39,13 @@ function rebuild_xsede() echo GENII_INSTALL_DIR is not set. return 1 fi - pushd $GENII_INSTALL_DIR + pushd "$GENII_INSTALL_DIR" ant clean - if [ $? -ne 0 ]; then return 1; fi + + if [ $? -ne 0 ]; then + error_sound + return 1 + fi popd build_xsede } @@ -46,10 +54,56 @@ 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 + + quickstarter="$GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh" + if [ ! -f "$quickstarter" ]; then + quickstarter="$XSEDE_TEST_ROOT/library/bootstrap_quick_start.sh" + fi + + bash "$quickstarter" + if [ $? -ne 0 ]; then + echo "failed to bootstrap a container." + error_sound + return 1 + fi + + success_sound +} + +# a shortcut for building without a clean, and creating a bootstrap container with the code. +function bu_bootstrap() +{ + build_xsede + if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi + + quickstarter="$GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh" + if [ ! -f "$quickstarter" ]; then + quickstarter="$XSEDE_TEST_ROOT/library/bootstrap_quick_start.sh" + fi + + bash "$quickstarter" + if [ $? -ne 0 ]; then + echo "failed to bootstrap a container." + error_sound + return 1 + fi - bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh - check_result "failed to bootstrap a container" + 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 bootstrap create the installer." + error_sound + return 1 + fi success_sound }