summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2013-09-02 13:21:55 +0200
committervarac <varacanero@zeromail.org>2013-09-02 13:21:55 +0200
commit9f50740f6120fd06bd70a070d8b0028f95649af2 (patch)
treee6a1f26cfda0716f0f1b428d971bfce202062389
parent666ac6b51cc8ccfdc7e644328bc3c7218b617181 (diff)
parente256eb371c17faab00d4e654ac26f5d6176f7664 (diff)
Merge branch 'master' of ssh://greyhound.leap.se/usr/local/bin/platform_test
-rwxr-xr-xleap-platform-test19
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