From 77c1626fbab1a645c92ead01ef3b029403e2d4df Mon Sep 17 00:00:00 2001 From: Rob Spieldenner Date: Fri, 15 Sep 2017 12:58:47 -0700 Subject: [PATCH] Travis setup --- .travis.yml | 15 +++++++++++++++ buildViaTravis.sh | 23 +++++++++++++++++++++++ installViaTravis.sh | 16 ++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .travis.yml create mode 100755 buildViaTravis.sh create mode 100755 installViaTravis.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..5966063 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: java +jdk: +- oraclejdk8 +sudo: false +install: "./installViaTravis.sh" +script: "./buildViaTravis.sh" +cache: + directories: + - "$HOME/.gradle" +env: + global: + - secure: FkKx7tPnSS0uG70Iv8cIsNynsA7BYbElQ2TRWpcYY4LBYfKiB2+Z/mRex8d0O92E1+ZqHIzXyAMpGy6F37sNUCrOG9ZkY8IYyx2joNHjgFqMM6dJg2XY22liBwATq5ectzqdorLY3ESGe0I6YKVum7wuRyNpVDc+wOn3SHJDrDM= + - secure: Ew05M9oZ/hH/bdpar3ajBzef1Jeu5+HMD4weMuaVcEZyBhDcQla54gDmaxqu6/drKb/z/F+WwAw6P7ehx8R6n/8ghw9tdR2LcFo5W67rKk9S6iPOltBfT3tn8hHXLJewunK8pJ3gp4bsqFIoXKAtQFvznDv16ERa/Qa+4oWSAsk= + - secure: aNmFi1Ai3jdjRw8h4B/TFowaigk+9nh78YAkYQ69iDi2J2PkKZvQRYu0ATQBHud1XnlQH1dKv54k8ofqGAymsMuQ7PfPXM0fEImdU0tv2QLBaINGl2TP+vjW7i02OUDQOm7Hv5F1XZHQcwh5r+34HB5j48ZSUNFOQSFIWNZIYro= + - secure: JDzobrcViIlXdiw0hING6Wn0FgU35m7U59rikptaafOwyoAtDbLM7tkymu7rw8MeOzxSsmv8MSU5VHgqFEpAVZ5tF8WW+3IXkcMnF/6VBSwodfS5ZtN0zdOp3p2rjvTnvUlexmur6UFf7pZFAhY/X6WedBq3Yhc1MRWPjNsH4Zo= diff --git a/buildViaTravis.sh b/buildViaTravis.sh new file mode 100755 index 0000000..812026d --- /dev/null +++ b/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 --stacktrace +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']' + case "$TRAVIS_TAG" in + *-rc\.*) + ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate --stacktrace + ;; + *) + ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final --stacktrace + ;; + esac +else + echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' + ./gradlew build --stacktrace +fi diff --git a/installViaTravis.sh b/installViaTravis.sh new file mode 100755 index 0000000..06a8629 --- /dev/null +++ b/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 --stacktrace +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then + echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' + ./gradlew -Prelease.travisci=true assemble --stacktrace +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 --stacktrace +else + echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' + ./gradlew assemble --stacktrace +fi