This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy path.travis.yml
67 lines (65 loc) · 3.33 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: java
# Enable container-based infrastructure
# see http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
# manage the caches here https://travis-ci.org/hawkular/hawkular/caches
cache:
directories: # keep in sync with CACHED_DIRECTORIES below
- $HOME/.m2/repository
- $HOME/cassandra-downloads
jdk:
- oraclejdk8
install:
- mvn -s .travis.maven.settings.xml -version -B
# unshallow is needed by license-maven-plugin
- git fetch origin --unshallow
- df -h .
- du -sh $HOME/.m2/repository
before_script:
- ulimit -u 4096
- ulimit -s 65535
- ulimit -a
- bash .travis.install.cassandra.sh
script:
- PROJECT_VERSION=`mvn 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
echo "Building with deployment" ;
mvn -fae -s .travis.maven.settings.xml -Pitest clean deploy -DdeployAtEnd=true -Dhawkular.backend=remote ;
else
echo "Building without deployment" ;
mvn -fae -s .travis.maven.settings.xml -Pitest clean install -Dhawkular.backend=remote ;
fi
notifications:
email: false
env:
global:
- CXX=g++-4.8
- secure: h2UBs+L83eGd8+vTvd4B5sh+ixjp67JB/5Ko/zGAEt6a3hIgrhqyjiXJmaEH3+jzJZKXUcUC6uOuxXHwZ4ODeF+McHViOjqqUGEynJ7AsLXqSr5SSBKZuY/pb69phQnh7Br5w2D+5IFHWEcjrSo/kHDbeZBVAMFRDeGVwpHy2yA=
- secure: BADgz+otMMO+gUlFNduU/mgFm1dOfv2ZWAYD3nO1nEwu7Y1QVUsqimHdlqntUcinILDVeD33oT27kElERvr7KyjfDEPSDAVUg5Y/5soezg/tBu0zi3iodAP2GynOMohS/Rfm4+3ajWuEe/Y2SYjFXgldMR9qjP+/31FsVtW8Op0=
- secure: "BiNdt5chVhT3StF2MK/z8nB/jAM/5feOMEAeY0bmhcQQUwzxrOb8G3G26rDBPL1FApCHOP1yjyCgxruboRik4ZmweXnelBV4q1K2m6hSV8GSNQvcVhlozA6KYt9CMFOIZo5WPpXBp6Kg7ftsMft2qxzyJRYjPqPhtOct8MNDMgY="
- secure: "IGipdqGmyhPBgXLjQ5sbWVIMbDpQvFUzuGsdoAPyeJbSNma1LFuJta6OQvueJhDoBPzAYQ/54NFW0WTrd1z3dtZjxo24/ZRvIy6TRPJRcpUSQMa+C9FwCmFb3LPsYF2NNdUKkW33610puI8iSJkt+MfCV9j5SAJc37+Cd2cXUoU="
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
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" "$HOME/cassandra-downloads")
- 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=`mvn --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
curl -X GET http://${DEPLOYMENT_JENKINS}/job/Build-Hawkular-Image/build?token=${DEPLOYMENT_JENKINS_TOKEN} ;
fi