Permalink
Browse files

Added OAuth version of update_site.

  • Loading branch information...
1 parent 3d9d6e9 commit e5386594fb7da990226f60cdd2a10da431da1239 @cwilso cwilso committed Nov 29, 2012
Showing with 45 additions and 0 deletions.
  1. +45 −0 scripts/update_site_oauth.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# Compresses the site's JS/CSS and cache busts links before uploading the app
+# to App Engine.
+#
+# Note: This script should be used in place of using appcfg.py update directly
+# to update the application on App Engine.
+#
+# Copyright 2012 Eric Bidelman <ericbidelman@html5rocks.com>
+
+for arg in $@
+do
+ if [ $arg = "--release" ] ; then
+ versionStr=v`date +%Y%m%d`
+
+ git checkout -b $versionStr
+
+ if [ $? -ne 0 ] ; then
+ git checkout $versionStr
+ git merge master
+ git commit -m "merging with master"
+ else
+ # Change app.yaml version to current date timestamp.
+ fl=../app.yaml
+ mv $fl $fl.old
+ sed "s/version: master/version: $versionStr/g" $fl.old > $fl
+ rm -f $fl.old
+
+ # Commit the new release branch.
+ git commit -m "Cutting release $versionStr" ../app.yaml
+ fi
+
+ git push origin $versionStr
+ fi
+done
+
+./compress_js_css.sh
+# Cache busting is handled by the GAE PageSpeed feature generating unique URLs.
+#./cachebust.py
+echo \# `date` >> ../cache.appcache
+appcfg.py --oauth2 update ../
+
+# Clean up our modified cache busted files and switch back to master.
+git checkout ../
+git checkout master

0 comments on commit e538659

Please sign in to comment.