You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2018/04/04 16:44:06 UTC

flink-web git commit: [hotfix] Sync build script with FLINK-9110

Repository: flink-web
Updated Branches:
  refs/heads/asf-site d37cedd8a -> 8b7c2dcb2


[hotfix] Sync build script with FLINK-9110


Project: http://git-wip-us.apache.org/repos/asf/flink-web/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink-web/commit/8b7c2dcb
Tree: http://git-wip-us.apache.org/repos/asf/flink-web/tree/8b7c2dcb
Diff: http://git-wip-us.apache.org/repos/asf/flink-web/diff/8b7c2dcb

Branch: refs/heads/asf-site
Commit: 8b7c2dcb2e46ee1dbc6f4dab49c8b4d89b46027d
Parents: d37cedd
Author: Timo Walther <tw...@apache.org>
Authored: Wed Apr 4 18:35:31 2018 +0200
Committer: Timo Walther <tw...@apache.org>
Committed: Wed Apr 4 18:40:58 2018 +0200

----------------------------------------------------------------------
 build.sh | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink-web/blob/8b7c2dcb/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index 72b37f0..21d1710 100755
--- a/build.sh
+++ b/build.sh
@@ -17,6 +17,9 @@
 # limitations under the License.
 ################################################################################
 
+RUBY=${RUBY:-ruby}
+GEM=${GEM:-gem}
+
 set -e
 cd "$(dirname ${BASH_SOURCE[0]})"
 
@@ -24,16 +27,18 @@ DIR="`pwd`"
 
 # We need at least bundler to proceed
 if [ "`command -v bundle`" == "" ]; then
-	echo "WARN: Could not find bundle."
-    echo "Attempting to install locally. If this doesn't work, please install with 'gem install bundler'."
+    RUBYGEM_BINDIR=""
 
-    # Adjust the PATH to discover the locally installed Ruby gem
-    if which ruby >/dev/null && which gem >/dev/null; then
-        export PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH"
-    fi
+    # Adjust the PATH to discover locally installed ruby gem binaries
+    export PATH="$(${RUBY} -e 'puts Gem.user_dir')/bin:$PATH"
 
-    # install bundler locally
-    gem install --user-install bundler
+    if [ "`command -v bundle`" == "" ]; then
+        echo "WARN: Could not find bundle."
+        echo "Attempting to install locally. If this doesn't work, please install with 'gem install bundler'."
+
+        # install bundler locally
+        ${GEM} install --user-install --no-format-executable bundler
+    fi
 fi
 
 # Install Ruby dependencies locally
@@ -47,11 +52,14 @@ JEKYLL_CMD="build"
 
 # if -p flag is provided, serve site on localhost
 while getopts ":p" opt; do
-	case $opt in
-		p)
-		JEKYLL_CMD="serve --baseurl= --watch"
-		;;
-	esac
+    case $opt in
+        p)
+        JEKYLL_CMD="serve --baseurl= --watch"
+        ;;
+        i)
+        [[ `${RUBY} -v` =~ 'ruby 1' ]] && echo "Error: building the docs with the incremental option requires at least ruby 2.0" && exit 1
+        JEKYLL_CMD="liveserve --baseurl= --watch --incremental"
+    esac
 done
 
 # use 'bundle exec' to insert the local Ruby dependencies