Repository: tapestry-5
Updated Branches:
  refs/heads/master 553fbe467 -> 6d9da908c


try to work around the 10 minute timeout if no output is produced by Gradle


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6d9da908
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6d9da908
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6d9da908

Branch: refs/heads/master
Commit: 6d9da908c0d191d835215263188fdcf24e5ac36e
Parents: 553fbe4
Author: Jochen Kemnade <[email protected]>
Authored: Thu Sep 17 08:38:22 2015 +0200
Committer: Jochen Kemnade <[email protected]>
Committed: Thu Sep 17 08:38:22 2015 +0200

----------------------------------------------------------------------
 .travis.yml     |  2 +-
 travis-build.sh | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6d9da908/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index ea2ea85..2989094 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,7 @@ before_install:
   - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid 
--make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 
1280x1024x16"
   - "export DISPLAY=:99.0"
 
-script: ./gradlew -Dci=true continuousIntegration
+script: ./travis-build.sh
 
 cache:
   directories:

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6d9da908/travis-build.sh
----------------------------------------------------------------------
diff --git a/travis-build.sh b/travis-build.sh
new file mode 100755
index 0000000..4d4d84d
--- /dev/null
+++ b/travis-build.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Abort on Error
+set -e
+
+export PING_SLEEP=30s
+export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+export BUILD_OUTPUT=$WORKDIR/build.out
+
+touch $BUILD_OUTPUT
+
+dump_output() {
+   echo Tailing the last 500 lines of output:
+   tail -500 $BUILD_OUTPUT  
+}
+error_handler() {
+  echo ERROR: An error was encountered with the build.
+  dump_output
+  exit 1
+}
+# If an error occurs, run our error handler to output a tail of the build
+trap 'error_handler' ERR
+
+# Set up a repeating loop to send some output to Travis.
+
+bash -c "while true; do echo \$(date) - building ...; sleep $PING_SLEEP; done" 
&
+PING_LOOP_PID=$!
+
+# My build is using maven, but you could build anything with this, E.g.
+# your_build_command_1 >> $BUILD_OUTPUT 2>&1
+# your_build_command_2 >> $BUILD_OUTPUT 2>&1
+./gradlew -Dci=true continuousIntegrationclean >> $BUILD_OUTPUT 2>&1
+
+# The build finished without returning an error so dump a tail of the output
+dump_output
+
+# nicely terminate the ping output loop
+kill $PING_LOOP_PID
\ No newline at end of file

Reply via email to