From 04ce378b7c48fd50a63f450e22d03a016a2bb6a3 Mon Sep 17 00:00:00 2001
From: buildmaster
Date: Wed, 17 Aug 2016 10:45:10 +0000
Subject: [PATCH] Sync docs from 1.1.x to gh-pages
---
1.1.x/ghpages.sh | 30 ++++++++++++++++++------------
1.1.x/index.html | 2 +-
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/1.1.x/ghpages.sh b/1.1.x/ghpages.sh
index fc8dfb20..a5d1acd5 100644
--- a/1.1.x/ghpages.sh
+++ b/1.1.x/ghpages.sh
@@ -27,9 +27,23 @@ fi
# Prop that will let commit the changes
COMMIT_CHANGES="no"
+MAVEN_PATH=${MAVEN_PATH:-}
+echo "Path to Maven is [${MAVEN_PATH}]"
+
+# Code getting the name of the current branch. For master we want to publish as we did until now
+# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
+# If there is a branch already passed will reuse it - otherwise will try to find it
+CURRENT_BRANCH=${BRANCH}
+if [[ -z "${CURRENT_BRANCH}" ]] ; then
+ CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
+ CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
+ CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
+fi
+echo "Current branch is [${CURRENT_BRANCH}]"
+git checkout ${CURRENT_BRANCH}
# Get the name of the `docs.main` property
-MAIN_ADOC_VALUE=$(mvn -q \
+MAIN_ADOC_VALUE=$("${MAVEN_PATH}"mvn -q \
-Dexec.executable="echo" \
-Dexec.args='${docs.main}' \
--non-recursive \
@@ -38,7 +52,7 @@ echo "Extracted 'main.adoc' from Maven build [${MAIN_ADOC_VALUE}]"
# Get whitelisted branches - assumes that a `docs` module is available under `docs` profile
WHITELIST_PROPERTY="docs.whitelisted.branches"
-WHITELISTED_BRANCHES_VALUE=$(mvn -q \
+WHITELISTED_BRANCHES_VALUE=$("${MAVEN_PATH}"mvn -q \
-Dexec.executable="echo" \
-Dexec.args="\${${WHITELIST_PROPERTY}}" \
org.codehaus.mojo:exec-maven-plugin:1.3.1:exec \
@@ -46,17 +60,9 @@ WHITELISTED_BRANCHES_VALUE=$(mvn -q \
-pl docs)
echo "Extracted '${WHITELIST_PROPERTY}' from Maven build [${WHITELISTED_BRANCHES_VALUE}]"
-# Code getting the name of the current branch. For master we want to publish as we did until now
-# http://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
-CURRENT_BRANCH=$(git symbolic-ref -q HEAD)
-CURRENT_BRANCH=${CURRENT_BRANCH##refs/heads/}
-CURRENT_BRANCH=${CURRENT_BRANCH:-HEAD}
-echo "Current branch is [${CURRENT_BRANCH}]"
-
# Stash any outstanding changes
###################################################################
-git diff-index --quiet HEAD
-dirty=$?
+git diff-index --quiet HEAD && dirty=$? || (echo "Failed to check if the current repo is dirty. Assuming that it is." && dirty="1")
if [ "$dirty" != "0" ]; then git stash; fi
# Switch to gh-pages branch to sync it with master
@@ -120,4 +126,4 @@ fi
git checkout ${CURRENT_BRANCH}
if [ "$dirty" != "0" ]; then git stash pop; fi
-exit 0
+exit 0
\ No newline at end of file
diff --git a/1.1.x/index.html b/1.1.x/index.html
index a979e984..f459f8a9 100644
--- a/1.1.x/index.html
+++ b/1.1.x/index.html
@@ -2057,7 +2057,7 @@ grabbing it in the bootstrap context and injecting one).