You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@incubator.apache.org by bd...@apache.org on 2021/07/21 13:58:22 UTC

[incubator] branch feature/build-error-detection created (now ca22e74)

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

bdelacretaz pushed a change to branch feature/build-error-detection
in repository https://gitbox.apache.org/repos/asf/incubator.git.


      at ca22e74  Detect JBake execution failures

This branch includes the following new commits:

     new ca22e74  Detect JBake execution failures

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


[incubator] 01/01: Detect JBake execution failures

Posted by bd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch feature/build-error-detection
in repository https://gitbox.apache.org/repos/asf/incubator.git

commit ca22e74be6fcd2a611f43994e75beee00218cf1c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Jul 21 15:57:38 2021 +0200

    Detect JBake execution failures
---
 bake.sh        | 7 +++++++
 build_local.sh | 9 +++++++--
 build_site.sh  | 9 +++++++--
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/bake.sh b/bake.sh
index b781bc6..2199ca6 100755
--- a/bake.sh
+++ b/bake.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+SUCCESS_FILE=$WORKDIR/.htaccess
 if [ -z ${JBAKE_HOME} ]
 then
   echo "Missing JBAKE_HOME variable" >&2
@@ -8,3 +9,9 @@ fi
 
 export JBAKE_OPTS="-Djavax.xml.accessExternalDTD=http"
 ${JBAKE_HOME}/bin/jbake $@
+
+if [ ! -f $SUCCESS_FILE ]
+then
+    echo "Missing $SUCCESS_FILE , JBake build failed?" >&2
+    exit 1
+fi
\ No newline at end of file
diff --git a/build_local.sh b/build_local.sh
index deac81a..9de8fee 100755
--- a/build_local.sh
+++ b/build_local.sh
@@ -1,11 +1,16 @@
 #!/bin/bash
 
 CURRENTDIR=`pwd`
-WORKDIR=/tmp/incubator-site
+export WORKDIR=/tmp/incubator-site
+
+function fatal() {
+    echo $* >&2
+    exit 1
+}
 
 rm -rf $WORKDIR
 mkdir -p $WORKDIR
 
 # just bake and serve the site
-./bake.sh -b -s . $WORKDIR
+./bake.sh -b -s . $WORKDIR || fatal "Build failed, exiting"
 
diff --git a/build_site.sh b/build_site.sh
index b345785..725aae4 100755
--- a/build_site.sh
+++ b/build_site.sh
@@ -1,14 +1,19 @@
 #!/bin/bash
 
 CURRENTDIR=`pwd`
-WORKDIR=/tmp/incubator-site
+export WORKDIR=/tmp/incubator-site
 ME=`basename $0`
 
+function fatal() {
+    echo $* >&2
+    exit 1
+}
+
 rm -rf $WORKDIR
 mkdir -p $WORKDIR
 
 # now bake the site
-./bake.sh -b . $WORKDIR
+./bake.sh -b . $WORKDIR || fatal "Build failed, exiting"
 
 # push all of the results to asf-site
 git checkout asf-site

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org