Skip to content

Commit ab3a3a5

Browse files
Conditional logic for pull request
1 parent f67f97c commit ab3a3a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gradle/buildViaTravis.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash
22
# This script will build the project.
33

4-
if [ "$TRAVIS_PULL_REQUEST" ]; then
5-
echo -e 'Build Pull Request ['$TRAVIS_PULL_REQUEST'] => Branch ['$TRAVIS_BRANCH']'
4+
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
5+
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
66
./gradlew -Prelease.useLastTag=true build
7-
elif [ ! "$TRAVIS_PULL_REQUEST" ] && [ "$TRAVIS_TAG" == "" ]; then
7+
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
88
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
99
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" snapshot --stacktrace
10-
elif [ ! "$TRAVIS_PULL_REQUEST" ] && [ "$TRAVIS_TAG" != "" ]; then
10+
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
1111
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
1212
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" final --stacktrace
1313
else

0 commit comments

Comments
 (0)