pmd/.travis/build-sonar.sh
Andreas Dangel e9ac18427a [ci] add a truncated travis_wait function
Since travis_wait outputs the "Still running" indication into the
same stream as the command's output, we need to make sure, we
output these indications to avoid a build timeout.
But to workaround the log size limit, we shouldn't output everything.
travis_wait_truncated now outputs the head immediately, while
only outputting the tail of the log after the command is finished.
2017-07-08 12:48:43 +02:00

18 lines
604 B
Bash

#!/bin/bash
set -e
source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
echo "Building PMD Sonar ${VERSION} on branch ${TRAVIS_BRANCH}"
if ! travis_isPush; then
echo "Not updating sonar, since this is not a push!"
exit 0
fi
# Run the build, truncate output due to Travis log limits
travis_wait_truncated ./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login=${SONAR_TOKEN} -B -V