Fix EWS GCE build scripts to detect which zone is available
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 03:00:55 +0000 (03:00 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 03:00:55 +0000 (03:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106524

Patch by Alan Cutter <alancutter@chromium.org> on 2013-01-14
Reviewed by Adam Barth.

* EWSTools/GoogleComputeEngine/build-chromium-ews.sh:
* EWSTools/GoogleComputeEngine/build-commit-queue.sh:
* EWSTools/GoogleComputeEngine/build-feeder-style-sheriffbot.sh:
* EWSTools/GoogleComputeEngine/findzone.sh: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139704 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/EWSTools/GoogleComputeEngine/build-chromium-ews.sh
Tools/EWSTools/GoogleComputeEngine/build-commit-queue.sh
Tools/EWSTools/GoogleComputeEngine/build-feeder-style-sheriffbot.sh
Tools/EWSTools/GoogleComputeEngine/findzone.sh [new file with mode: 0755]

index ffc07ea..a207f0c 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-14  Alan Cutter  <alancutter@chromium.org>
+
+        Fix EWS GCE build scripts to detect which zone is available
+        https://bugs.webkit.org/show_bug.cgi?id=106524
+
+        Reviewed by Adam Barth.
+
+        * EWSTools/GoogleComputeEngine/build-chromium-ews.sh:
+        * EWSTools/GoogleComputeEngine/build-commit-queue.sh:
+        * EWSTools/GoogleComputeEngine/build-feeder-style-sheriffbot.sh:
+        * EWSTools/GoogleComputeEngine/findzone.sh: Added.
+
 2013-01-14  Tim 'mithro' Ansell  <mithro@mithis.com>
 
         Adding an error string to AmbiguousCommitError.
index 45a1836..4c10a78 100755 (executable)
@@ -38,8 +38,7 @@ BUGZILLA_USERNAME=webkit.review.bot@gmail.com
 read -s -p "Bugzilla Password: " BUGZILLA_PASSWORD && echo
 
 PROJECT=google.com:webkit
-# FIXME: We should use gcutil to find a zone that's actually up.
-ZONE=us-east1-a
+ZONE=$(findzone.sh $PROJECT)
 IMAGE=projects/google/images/ubuntu-10-04-v20120621
 MACHINE_TYPE=n1-standard-4-d
 
index 5325ca7..af38c5c 100755 (executable)
@@ -41,8 +41,7 @@ SVN_USERNAME=commit-queue@webkit.org
 read -s -p "Subversion Password: " SVN_PASSWORD && echo
 
 PROJECT=google.com:webkit
-# FIXME: We should use gcutil to find a zone that's actually up.
-ZONE=us-east1-a
+ZONE=$(findzone.sh $PROJECT)
 IMAGE=projects/google/images/ubuntu-10-04-v20120621
 MACHINE_TYPE=n1-standard-4-d
 
index 51ceecd..782a0bc 100755 (executable)
@@ -38,8 +38,7 @@ read -s -p "Bugzilla Password: " BUGZILLA_PASSWORD && echo
 read -s -p "sheriffbot IRC Password: " IRC_PASSWORD && echo
 
 PROJECT=google.com:webkit
-# FIXME: We should use gcutil to find a zone that's actually up.
-ZONE=us-east1-a
+ZONE=$(findzone.sh $PROJECT)
 IMAGE=projects/google/images/ubuntu-10-04-v20120621
 MACHINE_TYPE=n1-standard-4-d
 
diff --git a/Tools/EWSTools/GoogleComputeEngine/findzone.sh b/Tools/EWSTools/GoogleComputeEngine/findzone.sh
new file mode 100755 (executable)
index 0000000..ac2cee5
--- /dev/null
@@ -0,0 +1,5 @@
+if [[ $# -ne 1 ]]; then
+    echo "Usage: findzone.sh PROJECT"
+fi
+
+echo $(gcutil --project=$1 listzones | grep UP | awk '{print $2}' | sort | tail -1)