Skip to content

Commit

Permalink
Added travis-ci build script
Browse files Browse the repository at this point in the history
  • Loading branch information
enricovianello authored Jan 26, 2018
1 parent b465101 commit 0277972
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: java
sudo: required
dist: trusty
jdk:
- openjdk8
install:
- /bin/bash travis/install-deps.sh
script:
- /bin/bash travis/build.sh
cache:
directories:
- "$HOME/.m2/repository"
30 changes: 30 additions & 0 deletions travis/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -e

export PING_SLEEP=30s
export BUILD_OUTPUT=travis/travis-build.out

dump_output() {
echo Tailing the last 1000 lines of output:
tail -1000 $BUILD_OUTPUT
}

error_handler() {
echo ERROR: An error was encountered with the build.
dump_output
exit 1
}

trap 'error_handler' ERR

bash -c "while true; do echo \$(date) - building ...; sleep $PING_SLEEP; done" &
PING_LOOP_PID=$!

mvn -B clean compile >> $BUILD_OUTPUT 2>&1
echo "storm-backend-server build completed succesfully"

mvn -B clean test >> $BUILD_OUTPUT 2>&1
echo "storm-backend-server tests completed succesfully"

tail -100 $BUILD_OUTPUT
kill ${PING_LOOP_PID}
9 changes: 9 additions & 0 deletions travis/install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -ex

pwd

sudo apt-get install -y wget
wget https://raw.githubusercontent.com/italiangrid/build-settings/master/maven/cnaf-mirror-settings.xml

mv cnaf-mirror-settings.xml ~/.m2/settings.xml

0 comments on commit 0277972

Please sign in to comment.