Skip to content

Commit

Permalink
[1.x] Setting up travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitesh Kant authored and Alex Panov committed Sep 11, 2015
1 parent db6dda5 commit 15169e4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
language: java
jdk:
- oraclejdk7
- openjdk6
- openjdk7
- oraclejdk8
sudo: false
install: "./installViaTravis.sh"
script: "./buildViaTravis.sh"
env:
global:
- secure: JReOX/9ZzNHP0CWrw2KEQ699fcWH+59kR7WjJTPglYMhIDsrcQlSV+AKPfXVuEh71HanWDaEjVtw1i0nMiZGd8k8jgU5iMbOaO1PmpjTxEHB97vnh9xexYaPsL1wzKlj51fEfwLX26SS3z7kRrvT4tQp/2A11aLqNVLJENEJUrE=
- secure: BSCZkXsCLzPQmFrojsE9m5zdB7LUnUSVjtgDvvZjqjOac6HaKEr0uBxCIpizR/GPGZA4sNypuSD6jtsaHTU3TGKfNCTzz2QwIwvpVrmGNqXR3Tv/p+grNMEVCVA6P3jpMWY1P0zg7m+OTiyF6roAZXc6LftOzygox2lDPK85D3M=
- secure: UYgocA/3TXjgIaoZRmSCzA0Ed3xImJxuQUw6GV/HUeHWoQyCD5myBpQcdIkAaQsJnNWY6h587oL3yDvIVjycVb2/9uhUAQ5NHjz5oT4D4aNECpQvdcHivAtGPfH5jZV6Cj57Q5hLeedCG0oeWamiZcR6AlSkT/FMlP0lhAPJFNM=
- secure: GtgBxV/2hQ9kPXpTAY9Iq7gi8+DaGGgu7KuEtAUw0nLenl2CIY3GLU3cP0oAbvtKDcKlbmYhfTLgj7pDoDy4ZrfmCTBnKNoDqOAZjNfRLnrlEi3x2KL7VMgnWPqyemOHoAnGq3URXEr363GKNhBtrynehiXJNtVTxmOD0JS/Smg=
cache:
directories:
- $HOME/.gradle
16 changes: 16 additions & 0 deletions gradle/buildViaTravis.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 "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -Prelease.useLastTag=true 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 --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final --stacktrace
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew -Prelease.useLastTag=true build
fi
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Apr 02 16:32:40 PDT 2015
#Wed Aug 19 00:23:55 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
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 15169e4

Please sign in to comment.