diff --git a/azure/citus-bot.sh b/azure/citus-bot.sh index 85a1d734..b57f2d1a 100755 --- a/azure/citus-bot.sh +++ b/azure/citus-bot.sh @@ -36,27 +36,26 @@ function cleanup { sh ./delete-resource-group.sh } +trap cleanup EXIT + rg=$1 export RESOURCE_GROUP_NAME=${rg} -if [ "$rg" != "citusbot_valgrind_test_resource_group" ]; then +if [ "$rg" == "citusbot_valgrind_test_resource_group" ]; then # If running valgrind tests, do not run cleanup function # This is because, as valgrind tests requires too much time to run, - # we start valgrind tests via nohup in ci. Hence ssh session + # we start valgrind tests via nohup in ci. Hence ssh session # will immediately be closed just after the fabric command is run - # - # We have a seperate job to terminate the machine and push the results - trap cleanup EXIT -else + trap - EXIT # If running valgrind tests, export VALGRIND_TEST to be 1 to ensure # only coordinator instance is created in create-cluster script export VALGRIND_TEST=1 -fi +fi ./create-cluster.sh public_ip=$(az group deployment show -g ${rg} -n azuredeploy --query properties.outputs.publicIP.value) -# remove the quotes +# remove the quotes public_ip=$(echo ${public_ip} | cut -d "\"" -f 2) echo ${public_ip} ssh-keyscan -H ${public_ip} >> ~/.ssh/known_hosts