You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2019/12/18 07:52:30 UTC

[isis] 08/25: ISIS-2062: further improvements on scripts

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 7e9e4960d3013cf7f9348de1539b4d097865ee67
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Dec 13 18:15:57 2019 +0000

    ISIS-2062: further improvements on scripts
---
 build-antora.sh             |  3 +++
 scripts/ci/_adoc-antora.sh  | 30 +++++++++++++++++++++++-------
 scripts/ci/build-site.sh    |  2 +-
 gen-adoc.sh => sync-adoc.sh |  0
 4 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/build-antora.sh b/build-antora.sh
new file mode 100644
index 0000000..24b5d7f
--- /dev/null
+++ b/build-antora.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+sh scripts/ci/_adoc-antora.sh $*
\ No newline at end of file
diff --git a/scripts/ci/_adoc-antora.sh b/scripts/ci/_adoc-antora.sh
index ba41054..556bfc4 100644
--- a/scripts/ci/_adoc-antora.sh
+++ b/scripts/ci/_adoc-antora.sh
@@ -1,16 +1,32 @@
 #!/bin/bash
 set -e
 
+PLAYBOOK=$1
+if [ -z "$PLAYBOOK" ]; then
+  PLAYBOOK=site.yml
+fi
+
+if [ ! -f "$PLAYBOOK" ]; then
+  PLAYBOOK=antora/playbooks/site-$PLAYBOOK.yml
+fi
+if [ ! -f "$PLAYBOOK" ]; then
+  PLAYBOOK=site.yml
+fi
+
+if [ -f "$PLAYBOOK" ]; then
+  PLAYBOOK=$(realpath -s $PLAYBOOK)
+else
+  PLAYBOOK=$(realpath -s site.yml)
+fi
+
+echo "\$PLAYBOOK = $PLAYBOOK"
+
+
 SCRIPT_DIR=$( dirname "$0" )
 if [ -z "$PROJECT_ROOT_PATH" ]; then
   PROJECT_ROOT_PATH=`cd $SCRIPT_DIR/../.. ; pwd`
 fi
 
-SITE_CONFIG=$1
-if [ -z "$SITE_CONFIG" ]; then
-  SITE_CONFIG=site.yml
-fi
-
 if [ -z "$REVISION" ]; then
   if [ ! -z "$SHARED_VARS_FILE" ] && [ -f "$SHARED_VARS_FILE" ]; then
     . $SHARED_VARS_FILE
@@ -21,7 +37,6 @@ if [ -z "$REVISION" ]; then
   export REVISION="SNAPSHOT"
 fi
 
-echo "running antora ..."
 if [ -z "$ANTORA_CMD" ]; then
   ANTORA_CMD=$(command -v antora 2>/dev/null)
   if [ -z "$ANTORA_CMD" ]; then
@@ -29,5 +44,6 @@ if [ -z "$ANTORA_CMD" ]; then
   fi
 fi
 
-$ANTORA_CMD --stacktrace $SITE_CONFIG
+echo "running antora ..."
+$ANTORA_CMD --stacktrace $PLAYBOOK
 
diff --git a/scripts/ci/build-site.sh b/scripts/ci/build-site.sh
index 74facc8..a082f76 100644
--- a/scripts/ci/build-site.sh
+++ b/scripts/ci/build-site.sh
@@ -17,7 +17,7 @@ bash $SCRIPT_DIR/_adoc-gen-config.sh
 WC=$(git status --porcelain | wc -l)
 if [ "$WC" -ne "0" ]; then
   git status --porcelain
-  echo "Some examples are out of date; run sync-examples.sh and commit, then try again" >&2
+  echo "Some examples are out of date; run sync-adoc.sh and commit, then try again" >&2
   exit 1
 fi
 
diff --git a/gen-adoc.sh b/sync-adoc.sh
similarity index 100%
rename from gen-adoc.sh
rename to sync-adoc.sh