Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Add config file for public travis CI
Browse files Browse the repository at this point in the history
Added a script for Travis to build xenon in background and
log output in a file. This is workaround for limitation of
Travis which does not allow log output to be more than
4MB for better UI and API experience. But xenon tests output
more than 4MB of logs. After the build is completed, this script
outputs last 1000 lines for debugging purpose.

Also updated git-commit-id-plugin with latest version because
old version was not working good on travis CI and was throwing errors

Change-Id: I466a5a23fcbe5107f06e0999473757b5e9b3350a
  • Loading branch information
Touseef Liaqat authored and Gerrit Code Review committed May 4, 2017
1 parent 367b01e commit bd733f9
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: java
sudo: required
install: true
dist: trusty

jdk:
- oraclejdk8

script:
- ./bg-build.sh

cache:
directories:
- '$HOME/.m2/repository'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 1.0 Brief Introduction to Xenon
# 1.0 Brief Introduction to Xenon [![Build Status](https://travis-ci.org/vmware/xenon.svg?branch=master)](https://travis-ci.org/vmware/xenon)

## 1.1 Xenon Highlights
Xenon is a framework for writing small REST-based services. (Some people call them microservices.)
Expand Down
33 changes: 33 additions & 0 deletions bg-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# Script to build xenon in background for Travis CI.
# Travis CI does not allow output log to be more than 4MB. To overcome this
# limitation we run the mvn build command in background in this script
# and redirect the output in a log file. At the end of build we print last
# few lines from the log file on to the console for debugging purpose.

set -ex

export WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export OUTPUT_FILE=$WORKING_DIR/output.out
touch $OUTPUT_FILE

print_output() {
echo "Last 1000 lines of output:"
tail -1000 $OUTPUT_FILE
}

handle_error() {
echo "ERROR: Caught an error in the build."
print_output
exit 1
}

trap 'handle_error' ERR

bash -c "while true; do echo \$(date) - building xenon...; sleep 30s; done" &
LOOP_PID=$!

./mvnw install -P coverage >> $OUTPUT_FILE 2>&1

print_output
kill -9 $LOOP_PID
5 changes: 4 additions & 1 deletion xenon-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.10</version>
<version>2.2.2</version>
<executions>
<execution>
<goals>
Expand All @@ -99,6 +99,9 @@
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>src/main/resources/xenon.git.properties</generateGitPropertiesFilename>
<excludeProperties>
<excludeProperty>git.tags*</excludeProperty>
<excludeProperty>git.dirty*</excludeProperty>
<excludeProperty>git.closest.*</excludeProperty>
<excludeProperty>git.branch.*</excludeProperty>
<excludeProperty>git.build.*</excludeProperty>
<excludeProperty>git.commit.message.*</excludeProperty>
Expand Down

0 comments on commit bd733f9

Please sign in to comment.