/
.travis.yml
50 lines (47 loc) · 2.36 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
language: java
# Enable container-based infrastructure
# see http://docs.travis-ci.com/user/workers/container-based-infrastructure/
# sudo=required and dist=trusty has a newer jdk8 but older maven
sudo: false
#sudo: required
#dist: trusty
# manage the caches here https://travis-ci.org/hawkular/hawkular-agent/caches
cache:
directories:
- $HOME/.m2/repository
jdk:
- oraclejdk8
notifications:
irc:
channels:
- chat.freenode.net#hawkular
on_success: change
install:
- ./mvnw -version -B
# unshallow is needed by license-maven-plugin
- git fetch origin --unshallow
script:
- ./mvnw -s .travis.maven.settings.xml verify -Pitest -Dfailsafe.useFile=false | grep -vF "[INFO] Downloading:" | grep
-vF "[INFO] Downloaded:"; test ${PIPESTATUS[0]} -eq 0
env:
global:
- secure: DOP9OifGr7yBDNdkn1Tl58ur4tJzqFaNzVktmX+KgpjDbWtKE3cqyqf1pElyAbSpTm8kVf/UAxUPyCXdRh/W7jj2jB6Tc5kwBCqM8UHjJ6QuZVGnpih4lO6EImV1MDW2+MNWvun7kdUgtRjCWohaYh4pTPAwOk8v7IfeewH1Ud4=
- secure: IG9j773bZtof+VCK20doXL6HiMnWfQVPD2MhkPc0wc1sXBi3QPatcsWqnOQSsTODyzZQu2yXrRD7cCsXHBFusYxMPIra08mjN4i16b6D4UdtpEhEucotqYCgawGhbv0kW/iRmGKPphAV4pZn+FNiBKJJQzBthBVnzz6WYkYdz7w=
before_cache:
# Clean the cached directories once their size exceeds the space left on the partition.
# This is important because Travis zips the chached directories to a temporary file on the same partition.
# Note that while we consider the summed size of all cached dirs, we remove only those ones that tend to grow over time
- CACHED_DIRECTORIES=("$HOME/.m2/repository")
- availBytes=$(df -P . | tail -1 | awk '{print $4}')
- cachedBytes=$(du -cs "${CACHED_DIRECTORIES[@]}" | tail -1 | awk '{print $1}')
- echo "Checking if the size of directories to cache ${cachedBytes} Bytes exceeds the free space ${availBytes} Bytes left on the current partition"
- if [ "${cachedBytes}" -gt "${availBytes}" ] ; then
echo "Cleaning the cached dirs (${cachedBytes} Bytes) because their size exceeds the free space (${availBytes} Bytes) left on the current partition"
rm -Rf "$HOME/.m2"
fi
after_success:
- PROJECT_VERSION=`./mvnw --batch-mode org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\['`
- if [[ "$PROJECT_VERSION" =~ .*SNAPSHOT ]] && [[ "${TRAVIS_BRANCH}" = "master" ]] && [[ "${TRAVIS_PULL_REQUEST}" = "false" ]];
then
./mvnw -s .travis.maven.settings.xml deploy -DskipTests -Dlicense.skip=true;
fi