@@ -55,19 +55,37 @@ function prepare {
55
55
git commit -m " v$NEW_VERSION "
56
56
}
57
57
58
- function publish {
59
- if [[ $IS_SNAPSHOT_BUILD ]]; then
60
- echo " -- Updating snapshot version"
61
- curl -G --data-urlencode " ver=$NEW_VERSION " http://code.angularjs.org/fetchLatestSnapshot.php
62
- exit 0;
63
- fi
64
58
59
+ function _update_snapshot() {
60
+ for backend in " $@ " ; do
61
+ echo " -- Updating snapshot version: backend=$backend "
62
+ curl -G --data-urlencode " ver=$NEW_VERSION " http://$backend :8003/fetchLatestSnapshot.php
63
+ done
64
+ }
65
+
66
+ function _update_code() {
65
67
cd $REPO_DIR
68
+
66
69
echo " -- Pushing code.angularjs.org"
67
70
git push origin master
68
71
69
- echo " -- Refreshing code.angularjs.org"
70
- curl http://code.angularjs.org/gitFetchSite.php
72
+ for backend in " $@ " ; do
73
+ echo " -- Refreshing code.angularjs.org: backend=$backend "
74
+ curl http://$backend :8003/gitFetchSite.php
75
+ done
76
+ }
77
+
78
+ function publish {
79
+ # The TXT record for backends.angularjs.org is a CSV of the IP addresses for
80
+ # the currently serving Compute Engine backends.
81
+ # code.angularjs.org is served out of port 8003 on these backends.
82
+ backends=(" $( dig backends.angularjs.org +short TXT | python -c ' print raw_input()[1:-1].replace(",", "\n")' ) " )
83
+
84
+ if [[ $IS_SNAPSHOT_BUILD ]]; then
85
+ _update_snapshot ${backends[@]}
86
+ else
87
+ _update_code ${backends[@]}
88
+ fi
71
89
}
72
90
73
91
source $( dirname $0 ) /../utils.inc
0 commit comments