Repository: mahout Updated Branches: refs/heads/master 79539f126 -> ea12bb60e
(nojira) 30 s ping script for travis Project: http://git-wip-us.apache.org/repos/asf/mahout/repo Commit: http://git-wip-us.apache.org/repos/asf/mahout/commit/ea12bb60 Tree: http://git-wip-us.apache.org/repos/asf/mahout/tree/ea12bb60 Diff: http://git-wip-us.apache.org/repos/asf/mahout/diff/ea12bb60 Branch: refs/heads/master Commit: ea12bb60e2ae509f9ba5f98c5688eda2a8ff4813 Parents: 79539f1 Author: Andrew Palumbo <[email protected]> Authored: Wed Apr 20 00:32:50 2016 -0400 Committer: Andrew Palumbo <[email protected]> Committed: Wed Apr 20 00:32:50 2016 -0400 ---------------------------------------------------------------------- .travis.yml | 6 +++--- runtests.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mahout/blob/ea12bb60/.travis.yml ---------------------------------------------------------------------- diff --git a/.travis.yml b/.travis.yml index 6072b26..7ee17d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ branches: matrix: include: - jdk: "oraclejdk7" - env: PROFILE="-Dhadoop.version=2.4.1 -Dscala-2.10 -Dflink.version=1.0.1 -Dspark.version=1.5.2" + env: PROFILE="-Dhadoop.version=2.4.1 -Dflink.version=1.0.1 -Dspark.version=1.5.2" git: depth: 10 @@ -26,7 +26,7 @@ notifications: env: global: - JAVA_OPTS=-Xmx6g + JAVA_OPTS=-Xmx2g before_install: - wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip @@ -34,5 +34,5 @@ before_install: - export M2_HOME=$PWD/apache-maven-3.3.9 - export PATH=$M2_HOME/bin:$PATH - +script: ./run-tests.sh http://git-wip-us.apache.org/repos/asf/mahout/blob/ea12bb60/runtests.sh ---------------------------------------------------------------------- diff --git a/runtests.sh b/runtests.sh new file mode 100755 index 0000000..8c487b2 --- /dev/null +++ b/runtests.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Abort on Error +set -ev + +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 +mvn clean install -DskipTests >> $BUILD_OUTPUT 2>&1 +mvn test >> $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 +
