guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjum...@apache.org
Subject [57/58] [abbrv] incubator-guacamole-website git commit: Add support for automatic staging of commits to asf-git.
Date Sun, 24 Apr 2016 01:03:11 GMT
Add support for automatic staging of commits to asf-git.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/commit/8479d56e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/tree/8479d56e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/diff/8479d56e

Branch: refs/heads/master
Commit: 8479d56ea9eea3e9ca0ff2152d88aad84025b778
Parents: 04429d7
Author: Michael Jumper <mjumper@apache.org>
Authored: Sat Apr 23 17:37:19 2016 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Sat Apr 23 17:55:17 2016 -0700

----------------------------------------------------------------------
 build.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/blob/8479d56e/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index 911f76c..f223b7d 100755
--- a/build.sh
+++ b/build.sh
@@ -30,6 +30,9 @@
 # The built results will be available in the "content" subdirectory of the
 # source tree.
 #
+# To stage the results for commit to the "asf-git" branch, specify "stage"
+# instead of an HTTP port number.
+#
 # USAGE:
 #
 #     ./build.sh [HTTP SERVER PORT]
@@ -127,20 +130,61 @@ serve() {
 
 }
 
+##
+## Stages the current build result for commit to the "asf-git" branch.
+##
+stage() {
+
+    # Verify required programs are installed
+    assert_program git
+    assert_program mktemp
+
+    # Move contents to temporary directory
+    TMP="`mktemp -d -p "$PWD"`"
+    mv content/* "$TMP"
+    rmdir content
+
+    # Change to asf-git
+    git checkout asf-git
+
+    # Replace contents
+    rm -rf content
+    mv "$TMP" content
+
+    # Stage for commit
+    git add content/
+    git clean -xfd .
+
+    # Done
+    log "Content staged for commit. Use git to commit the results when ready."
+    log "NOTE: The build.sh script will no longer exist. To serve the staged "
+    log "contents, run:"
+    log
+    log "    ruby -run -e httpd content/ -p PORT"
+    log
+    log "where PORT is the port number where the HTTP server should listen."
+
+}
+
 # Verify number of arguments
 if [ "$#" -gt 1 -o "$1" = "-h" ]; then
     log "Usage:"
     log "    $0 -h       # Display this message"
     log "    $0          # Build website"
     log "    $0 PORT     # Build website and serve from the given PORT"
+    log "    $0 stage    # Build website and stage the contents for asf-git"
     exit 1
 fi
 
 # Build in all cases
 build
 
-# Serve on requested port
-if [ -n "$1" ]; then
+# Stage for commit (if requested)
+if [ "$1" = "stage" ]; then
+    stage
+
+# Otherwise assume port number and serve
+elif [ -n "$1" ]; then
     serve "$1"
 fi
 


Mime
View raw message