Permalink
Browse files

Add a small shell script to automate updating github pages.

  • Loading branch information...
1 parent f1728a7 commit 23b7847f8655839fae6dca436cbe573960e4e32d @stephank committed Jun 6, 2010
Showing with 38 additions and 0 deletions.
  1. +38 −0 util/update_gh_pages.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Updates gh-pages branch with distributables from the current HEAD.
+
+if [ ! -f arashi.html ]; then
+ echo "Execute from the project root!"
+ exit 1
+fi
+
+echo "Uncommitted changes will be lost!"
+echo "Press Ctrl+C to abort, or Enter to continue."
+read dummy
+
+TEMPTAR="/tmp/arashi-gh-pages.tar"
+
+set -e
+set -x
+
+REVISION=`git rev-parse HEAD`
+
+make dist
+(
+ cd dist && \
+ tar -cf ${TEMPTAR} * && \
+ mv arashi.html index.html
+)
+
+git clean -fdx
+git checkout gh-pages
+
+tar -xf ${TEMPTAR}
+rm -f ${TEMPTAR}
+
+git add -A
+git commit -a -m "Updating from revision ${REVISION}"
+git push origin gh-pages
+
+git checkout master

0 comments on commit 23b7847

Please sign in to comment.