-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
25 lines (22 loc) · 762 Bytes
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This file holds common parameters for the VM start/stop scripts
VM_NAME=container-vm-guestbook
ZONE=us-central1-a
MACHINE_TYPE=n1-standard-1
function wait_vm_ready() {
VM_IP=$(gcloud compute instances list ${VM_NAME} --format=text | grep natIP | cut -f 2 -d ':' | tr -d ' ')
echo
echo "Waiting for VM to be ready on ${VM_IP}."
echo
echo " This will continually check to see if the guestbook is up and "
echo " running. If something goes wrong this could hang forever."
echo
until $(curl --output /dev/null --silent --head --max-time 1 --fail "http://${VM_IP}"); do
printf "."
sleep 2
done
echo
echo "Container VM Guestbook is now up and running"
echo
echo " http://${VM_IP}"
echo
}