-
Notifications
You must be signed in to change notification settings - Fork 36
/
.travis.yml
70 lines (65 loc) · 3.39 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
68
69
language: java
jdk:
- openjdk8
# 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 clean verify -Pitest
env:
global:
- secure: DOP9OifGr7yBDNdkn1Tl58ur4tJzqFaNzVktmX+KgpjDbWtKE3cqyqf1pElyAbSpTm8kVf/UAxUPyCXdRh/W7jj2jB6Tc5kwBCqM8UHjJ6QuZVGnpih4lO6EImV1MDW2+MNWvun7kdUgtRjCWohaYh4pTPAwOk8v7IfeewH1Ud4=
- secure: IG9j773bZtof+VCK20doXL6HiMnWfQVPD2MhkPc0wc1sXBi3QPatcsWqnOQSsTODyzZQu2yXrRD7cCsXHBFusYxMPIra08mjN4i16b6D4UdtpEhEucotqYCgawGhbv0kW/iRmGKPphAV4pZn+FNiBKJJQzBthBVnzz6WYkYdz7w=
# DOCKER_USER=xyz used to push to docker hub
- secure: "p7+Sgoow5aTEp9G6bCRQcRklpMmBhYqEjREyswWymqYnkTyrd1TD1oWRYGrt/D3F6om4q71Kv4BN3hJGuKBCxxf6eJMUYBXrl5RY/M3wjGSNk0yFuTbu9c2EkEyf4AsXbeDMU/nXirZv39KikZKeOX0i3VAb161ORy0wwkN7oyI="
# DOCKER_PASS=xyz used to push to docker hub
- secure: "Ys9j6Id5xWbt6AAg6TXpokytGHgqGPN/+T1Abux04u8afTztLY0YrmrQkRLSQlVraYB2sDK+kOkr1wYo4Kr0GveNDbGJMwaXlHC/j2HEmqKy6fxgXgt8Ty93rwjX9w9EHqGYXSkS/O0KKIOpMUB15chhPx1LulNOHYjNo/Bv+qY="
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
# Push the distro to docker hub
after_success:
- export COMMIT_HASH=${TRAVIS_COMMIT}
- export DOCKER_VERSION=$(if [ "$TRAVIS_TAG" != "" ]; then echo $TRAVIS_TAG; elif [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi)
- export DOCKER_USER=$(if [ "$DOCKER_USER" == "" ]; then echo "unknown"; else echo $DOCKER_USER ; fi)
- export DOCKER_PASS=$(if [ "$DOCKER_PASS" == "" ]; then echo "unknown"; else echo $DOCKER_PASS ; fi)
- echo DOCKER_VERSION=$DOCKER_VERSION
- docker-dist/build.sh "$DOCKER_VERSION" "hawkular/wildfly-hawkular-javaagent"
- docker --version
- docker images
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS"
- docker push hawkular/wildfly-hawkular-javaagent:${DOCKER_VERSION}
# Build only the master branch (for "latest" release) and version tags (e.g. "1.2.3" or "1.1.2.RC2" or "2.1.5.Final")
# Add branch names below if we want to build and then push docker images built off of those branches.
branches:
only:
- master
- /^(\d+\.){2}(\d+){1}(\.[a-zA-Z\d]+)?$/
- hawkular-1275