Skip to content

Commit

Permalink
3.x: Do not update snapshot Javadocs from secondary branches (#6752)
Browse files Browse the repository at this point in the history
* 3.x: Do not update snapshot Javadocs from secondary branches

* Also disable creating snapshots for secondary branches

* Fix TRAVIS_BRANCH is the same as TRAVIS_TAG for releases case

* Space needed after [ and before "
  • Loading branch information
akarnokd authored Dec 10, 2019
1 parent 0f0e219 commit ec81e8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ export GRADLE_OPTS=-Xmx1024m

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -PreleaseMode=pr build
./gradlew -PreleaseMode=pr build --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -PreleaseMode=branch -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
if [ "$TRAVIS_BRANCH" != "3.x" ]; then
echo -e 'Build secondary Branch (no snapshot) => Branch ['$TRAVIS_BRANCH']'
./gradlew -PreleaseMode=pr build --stacktrace
else
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -PreleaseMode=branch -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
fi
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -PreleaseMode=full -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
Expand Down
6 changes: 6 additions & 0 deletions gradle/push_javadoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
exit 0
fi

# only when on the 3.x branch and not tagged
if [ "$TRAVIS_BRANCH" != "3.x" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e "On a secondary branch '$TRAVIS_BRANCH', skipping JavaDocs pushback."
exit 0
fi

# get the current build tag if any
buildTag="$TRAVIS_TAG"
echo -e "Travis tag: '$buildTag'"
Expand Down

0 comments on commit ec81e8c

Please sign in to comment.