summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2015-08-07 20:20:30 -0700
committerDavid Tolnay <dtolnay@gmail.com>2015-08-08 00:29:22 -0700
commite404a1a96d125dfcb11d42f2725820c9d5b366fc (patch)
tree60a43cee97fb9e188c6e5a82d353493cd82b3c5d /scripts
parentb23d07875e8726caf6578e30feedb12b29ddf664 (diff)
Script to update gh-pages from master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-website27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/update-website b/scripts/update-website
new file mode 100755
index 00000000..4578a051
--- /dev/null
+++ b/scripts/update-website
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# This script builds the website from the docs directory of
+# the current branch and copies it over to the gh-pages
+# branch.
+
+set -eu
+set -o xtrace
+
+# build website
+scriptdir=`dirname "$0"`
+cd "$scriptdir"/../docs
+rm -rf output
+rake build
+cd ..
+
+# copy to /tmp
+tmpdir=$(mktemp -d -t jq.website.XXXXXXXXXX)
+cp -r docs/output/* "$tmpdir"
+
+# copy to gh-pages
+git checkout gh-pages
+cp -r "$tmpdir"/* .
+
+# clean up
+rm -rf "$tmpdir"
+echo SUCCESS