Skip to content

Commit

Permalink
Setup travis
Browse files Browse the repository at this point in the history
  • Loading branch information
rspieldenner committed Apr 21, 2016
1 parent 52d78ff commit 0685442
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"
cache:
directories:
- "$HOME/.gradle/caches"
env:
global:
- secure: CmXjxTfZrRBwl3pw2xtjC5dZn2ESuCWRcVBViJ+9qBI+yAdtCJ3075BFErJtmG2/JHc0AjpQ8ffplEoKynGfomOArumS0A5WE80VhwwoU9mM6AE/agOurH9a4AaL/QbZKrn7fgW8X97BPtwu/KgHFfTtB8h+NpaiMdlviIGugGE=
- secure: RjIttxEo0DbnZ8J1yM0EYNDrSK6dFFqDFfi2bd9CO7gnZM+OYbiskWL6dk6EVJRIqZOILFwUl/iQaJz95yeBSxIp1IG2Vu+vmMIAu9yj4ZJIla3kiV9hB701sc3RSyDyaBEZSfVw10aWCnr/IsLBoGs9SGk7plGF6CSTZ8n+z8o=
- secure: Znh26tR/V1NIFAGKVhVjlTH/2Awe8fNUsYRxmmTIQuCmCTwP/LWVTNzNfQeOf2MSf64SRQbW3L1mc++EK30vBRPeMdWZK4UxNXsKJeeH/98/gDHxrUGoYDznSJqGdRFiIncWDbMaZ/72MuVUC/roWCyy130t2jjm+36lzkPWrFI=
- secure: RDKNmzElSVQ1i5Q/g2sCrJnvrwcma47Bkf+6we/jIz2XtiHXiWet9R5ImAzifr4TO4zpjb3dXrpjVg85GPK4l1v6Qzd6CH+D8unzQpfTLH17om7U1Bp7GIeCnCJpL8VHJbn72ZSHFJh9PUI2ep6J63ByQRigXYUTgM81xXvJ3iQ=
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 0685442

Please sign in to comment.