diff options
| -rwxr-xr-x | leap-platform-test | 19 | 
1 files changed, 18 insertions, 1 deletions
diff --git a/leap-platform-test b/leap-platform-test index 2cfc101..adfc411 100755 --- a/leap-platform-test +++ b/leap-platform-test @@ -116,6 +116,7 @@ deploy() {      if [ -s $ERRLOG1 ]      then +      deploy_success=false        versions=`versions`        msg="From: $MAIL_FROM\nTo: $MAIL_TO\nSubject: leap_platform $PLATFORM_BRANCH branch on \"$vm\" had errors !\n\n"        echo "`date`: $msg" | tee -a $LOG1 $LOG2 $ERRLOG2 @@ -147,6 +148,7 @@ get_ip () {  reset_deploy() { +  local nodes=$@    update_platform    update_leap_cli @@ -156,7 +158,7 @@ reset_deploy() {    echo "Starting deploy_nodes for nodes $@ as background tasks on `date`" -  for i in $@ +  for i in $nodes    do      $LEAP_CMD $OPTS local reset $i      wait_for_node $i @@ -167,8 +169,21 @@ reset_deploy() {    # have finished    echo "Waiting for last deploy process has finished..."    wait +   +  if [ $deploy_success -a -n $MAIL_TO  ] +  then +    versions=`versions` +    msg="From: $MAIL_FROM\nTo: $MAIL_TO\nSubject: Success ! leap_platform $PLATFORM_BRANCH branch deployed fine\n\n" +    msg="${msg}Tested on `date` on these nodes: \"$nodes\"\nwith following versions/git commit IDs: \n\n$versions" + +    echo "Sending success mail to $MAIL_TO" +    printf "$msg" | /usr/sbin/sendmail -t + +  fi +  } +  log_start() {    echo    echo "Starting $0 on `date`" @@ -248,6 +263,8 @@ all=false  print_versions=false  # default in lib/leap_cli/leapfile.rb  IP_PREFIX='10.5.5' +deploy_success=true +  if ! options=$(getopt -o avVc:h -l all,verbose,versions,config:,help -- "$@")  then   | 
