commit - 1788d3fd5eddcef272eee14d80fa64a1aff2249c
commit + aaf95dbec81c13035afd16d3c8dc711076ddae4b
blob - ee918bc6bb0208dbf785616eb16b076649aaaeae
blob + dfadbc1a7536fa05415ab2e9f39ad84fcc342cd2
--- notify.pl
+++ notify.pl
if ($function =~ /notify/) {
mailout(\%conf, \%vms);
-} elsif ($function =~ /(deployed|msg|thanx)/ and $function_variable !~ /empty/) {
+} elsif ($function =~ /(deployed|redeployed|msg|thanx)/ and $function_variable !~ /empty/) {
my %slice = %vms{$function_variable};
mailout(\%conf, \%slice);
} elsif ($function =~ /(renewal|subscription|deprovision)/) {
}
mailout(\%conf, \%vms);
} else {
- print "usage: " . basename($0) . " [stopped | renewal | notify | deprovision] | [deployed | msg | thanx] <vmid>\n";
+ print "usage: " . basename($0) . " [stopped | renewal | notify | deprovision] | [deployed | redeployed | msg | thanx] <vmid>\n";
}
blob - 5bf1da4b347b857164889302b7f181e0c128e5ef
blob + df8d272a272e653ff4dde5888a8131295bcbecdd
--- relaunch.sh
+++ relaunch.sh
echo "unable to find ${VMS}/${1}"
exit 1
fi
-if [[ ! -f "${IMAGES}/${1}.qcow2" ]]; then
- echo "unable to find ${IMAGES}/${1}.qcow2"
+
+deploy.pl
+rcctl restart dhcpd
+vmctl reload
+sleep 10
+
+auto-deploy.exp ${1}
+if [ $? != 0 ]; then
+ vmctl stop -f ${1}
+ rm -rf /var/vmm/${1}.qcow2
+ pushover.pl -m "$(hostname -s) ${1} failed deploy" -p 1
exit 1
+else
+ vmctl stop -f ${1}
fi
-/home/mischa/bin/deploy.pl
+deploy.pl
rcctl restart dhcpd
vmctl reload
-vmctl start ${1}
-sleep 30
-echo "SUCCES! - deployed ${1}"
-cp -v /home/mischa/templates/email-deployed.txt-redeploy /home/mischa/templates/email-deployed.txt
-/home/mischa/bin/notify.pl deployed ${1}
-cp -v /home/mischa/templates/email-deployed.txt-orig /home/mischa/templates/email-deployed.txt
+sleep 10
+
+auto-start.exp ${1}
+if [ $? ]; then
+ echo
+ echo "SUCCES! - re-deployed ${1}"
+ notify.pl redeployed ${1}
+ pushover.pl -m "$(hostname -s) ${1} re-deployed"
+fi