From 22415d0725fa56857f3e7744a0cd1c741e2e9191 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 3 Dec 2013 20:16:39 -0500 Subject: [PATCH] added success and error sounds, added bootstrapping function for xsede builds. --- scripts/archival/serene_backer_upper.sh | 2 +- scripts/buildor/build_xsedes.sh | 48 +++++++++++++------------ scripts/core/functions.sh | 15 ++++++++ 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/scripts/archival/serene_backer_upper.sh b/scripts/archival/serene_backer_upper.sh index 9a17ab1b..517b4733 100644 --- a/scripts/archival/serene_backer_upper.sh +++ b/scripts/archival/serene_backer_upper.sh @@ -18,7 +18,7 @@ function check_if_failed() # if there was a failure detected. function exit_if_failed() { - check_if_failed + check_if_failed $* if [ $? -ne 0 ]; then exit 1 fi diff --git a/scripts/buildor/build_xsedes.sh b/scripts/buildor/build_xsedes.sh index f30fdedc..f51a0375 100644 --- a/scripts/buildor/build_xsedes.sh +++ b/scripts/buildor/build_xsedes.sh @@ -11,33 +11,22 @@ function build_xsede() pushd $GENII_INSTALL_DIR if [ $? -ne 0 ]; then return 1; fi echo "Build starting at: $(date)" - \rm -rf unit-test-reports -# # update the libs first. -# ant update - if [ $? -ne 0 ]; then return 1; fi - # then build the trunk. + +# 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 + + # build the trunk. ant -Dbuild.targetArch=64 build if [ $? -ne 0 ]; then return 1; fi - # fix memory limits. -#hmmm: clean these up. - if [ -f runContainer.sh ]; then - sed -i -e "s/-Xmx512M/-Xmx2G/" "runContainer.sh" - chmod 755 "runContainer.sh" - fi - if [ -f grid ]; then -# sed -i -e "s/-Xmx512M/-Xmx1G/" "grid" - chmod 755 "grid" - fi - if [ -f runContainer.bat ]; then - sed -i -e "s/-Xmx512M/-Xmx2G/" "runContainer.bat" - chmod 755 "runContainer.bat" - fi - if [ -f grid.bat ]; then -# sed -i -e "s/-Xmx512M/-Xmx1G/" "grid.bat" - chmod 755 "grid.bat" - fi echo "Build done at: $(date)" popd + + success_sound } function rebuild_xsede() @@ -53,3 +42,16 @@ function rebuild_xsede() build_xsede } +# a shortcut for doing a new build and creating a bootstrap container with it. +function rebu_bootstrap() +{ + rebuild_xsede + check_result "failed to rebuild xsede code" + + bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh + check_result "failed to bootstrap a container" + + success_sound +} + + diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index bf92636c..903a17d1 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -33,6 +33,20 @@ if [ -z "$skip_all" ]; then cd "$1" } + function success_sound() + { + if [ ! -z "$CLAM_FINISH_SOUND" ]; then + play "$CLAM_FINISH_SOUND" + fi + } + + function error_sound() + { + if [ ! -z "$CLAM_ERROR_SOUND" ]; then + play "$CLAM_ERROR_SOUND" + fi + } + # checks the result of the last command that was run, and if it failed, # then this complains and exits from bash. the function parameters are # used as the message to print as a complaint. @@ -40,6 +54,7 @@ if [ -z "$skip_all" ]; then { if [ $? -ne 0 ]; then echo -e "failed on: $*" + error_sound exit 1 fi } -- 2.34.1