Skip to content

Commit ec81e8c

Browse files
authored
3.x: Do not update snapshot Javadocs from secondary branches (#6752)
* 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 "
1 parent 0f0e219 commit ec81e8c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

gradle/buildViaTravis.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ export GRADLE_OPTS=-Xmx1024m
1212

1313
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
1414
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
15-
./gradlew -PreleaseMode=pr build
15+
./gradlew -PreleaseMode=pr build --stacktrace
1616
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
17-
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
18-
./gradlew -PreleaseMode=branch -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
17+
if [ "$TRAVIS_BRANCH" != "3.x" ]; then
18+
echo -e 'Build secondary Branch (no snapshot) => Branch ['$TRAVIS_BRANCH']'
19+
./gradlew -PreleaseMode=pr build --stacktrace
20+
else
21+
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
22+
./gradlew -PreleaseMode=branch -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace
23+
fi
1924
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
2025
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
2126
./gradlew -PreleaseMode=full -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build --stacktrace

gradle/push_javadoc.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
1414
exit 0
1515
fi
1616

17+
# only when on the 3.x branch and not tagged
18+
if [ "$TRAVIS_BRANCH" != "3.x" ] && [ "$TRAVIS_TAG" == "" ]; then
19+
echo -e "On a secondary branch '$TRAVIS_BRANCH', skipping JavaDocs pushback."
20+
exit 0
21+
fi
22+
1723
# get the current build tag if any
1824
buildTag="$TRAVIS_TAG"
1925
echo -e "Travis tag: '$buildTag'"

0 commit comments

Comments
 (0)