Skip to content

Commit

Permalink
Travis conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Spieldenner committed May 9, 2016
1 parent 1e1e1c8 commit 55014b1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: java
jdk:
- oraclejdk8
sudo: false
install: "./installViaTravis.sh"
script: "./buildViaTravis.sh"
env:
global:
- secure: h9SekBb+yaYWjrEhHKHQD6kgdepD0WEur0NCi93jX/i/kEpbemO51vVfnTdaRBMIFEfIu6rbhGpCV+X0wP6yPIEpGdsJgY4BejBy/61HsemLfp3tBnMbzrfFR1SBoGsegih4L5012js2FpQ2dVwEj98p73Erc4DQGCBkhN7+Eqs=
- secure: N348L4ACNYYs24g9mzto0VGms5t2E8bbPGXJFjrBRfvQa6Bfq8CDyxWEd4sZw3Ozx1CrlhJdEVYUgQfUOkfTp6ky+ZL1Le+mg9pU7iSx7NhV9TUd2ECW1Rq7pSSmcdEjclwioK+4jmlkbyLCeQfXT+5bCm0u9L2OMj7sX4pdSZE=
- secure: h0pIY9B+nr/yeUa0soWMDdfKi9BaelcfwGbt35lReD8DGvLJZ7AxYtMJOEmnxctKdUoaCg5jdp0fg6/Wapaiw8St/0PC3ccKUHn33zoo0Emv7GhtqwpF4YMVdr6vVzFt7RKfAOn/miRAcufOWHDk41TkzXQcVKMpTn/b1YwngKw=
- secure: ggH61i/xP1jtMXssrCMOQ5Mc7z9FTVE8S1YHC71Qg1To/lFBDb2VfTTifuGULSonRyz6RWq1S3qw1CeP7SQbXtlLkmsz0AtgQVIqclrGM9ZZdfYuY8GGKmsqpL/e7HAvjN5eELLgAH8TmBZv5lAxzEnRRX3xnEbWmxnp0FnRyNU=
cache:
directories:
- "$HOME/.gradle/caches"
23 changes: 23 additions & 0 deletions buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 55014b1

Please sign in to comment.