Skip to content

Commit

Permalink
Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
rspieldenner committed Jun 2, 2016
1 parent b97f3a3 commit 2222c4e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .travis.yml
@@ -0,0 +1,15 @@
language: java
jdk:
- oraclejdk8
sudo: false
install: "./installViaTravis.sh"
script: "./buildViaTravis.sh"
env:
global:
- secure: Zgn8jqagplC6oK5H6JgdoWmWBk8elx1Om+29JcIpsrJZsZ8xfNgwWIBcLpuWt3DScXQm/6NqIVedFSOskC0H0+CHjK10e5NYKon92EBDHgmDXox0IzW6FLVGbJqMVXUa2/dcL6mbAP50R4qFg4kMKsCjTEVETSXOmpQmpNn22qY=
- secure: NstY1DRNoyKH7yiD0OgBy8lTSVrlhoObiVVJWv5vd1wXJb0NtSN8R+dlbT4Dh/WaGxVfWQrdOsBfKjWeuNPBEoaE5kaO9zgYfO+X1sxxjHeJ9rpH/at/vXNMEfJl1TpgNH3R3MAkrxtn5EyaudC+wxfTx0TthM0qFwOLBvVB6K4=
- secure: E78ZBtq6I8hpxZxkykwtmC1ISjsNKcuOY3KIBVeDKlgQaugb3/fAqDpZz/UowhEf2cG4ISv6hX7peXd55AAMyf0qIN1/USbt4bsFK18X6F+p1s4yQBDILjZvozWPapedQuRKXDWGgUxldOaxguOpz/5w0u/C5QnM/hT8kKUjIIo=
- secure: G/mNrxHEqpVeTY4HaJoGOvrj0QMpmgVUt/Uljbe5n2+cpArD1dIOygtnklOPRTuhDTGtn8YavSBBMvAuxmjY80L8XRKCCGltxDk5ZwteS3KnJASjOMCUOmkDAbKow8nNqmxNsA50oK6gQuokTiuIQtndPZ0CAc2OgDsFnDWSuHE=
cache:
directories:
- "$HOME/.gradle/caches"
2 changes: 1 addition & 1 deletion build.gradle
@@ -1,5 +1,5 @@
plugins {
id 'nebula.netflixoss' version '3.2.0'
id 'nebula.netflixoss' version '3.2.3'
}

subprojects {
Expand Down
23 changes: 23 additions & 0 deletions buildViaTravis.sh
@@ -0,0 +1,23 @@
#!/bin/bash
# This script will build the project.

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew build
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
case "$TRAVIS_TAG" in
*-rc\.*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate
;;
*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew build
fi
16 changes: 16 additions & 0 deletions installViaTravis.sh
@@ -0,0 +1,16 @@
#!/bin/bash
# This script will build the project.

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Assemble Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew assemble
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true assemble
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Assemble Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true assemble
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew assemble
fi

0 comments on commit 2222c4e

Please sign in to comment.