From c175a34df0793a8bd50119ba0a00e84f3e4241bb Mon Sep 17 00:00:00 2001 From: akarnokd Date: Tue, 10 Dec 2019 16:04:46 +0100 Subject: [PATCH 1/4] 3.x: Do not update snapshot Javadocs from secondary branches --- gradle/push_javadoc.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gradle/push_javadoc.sh b/gradle/push_javadoc.sh index 2f7e6ee8b9..4df07cd5cd 100644 --- a/gradle/push_javadoc.sh +++ b/gradle/push_javadoc.sh @@ -14,6 +14,12 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0 fi +# only when on the 3.x branch +if [ "$TRAVIS_BRANCH" != "3.x" ]; 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'" From f77cfe9a53324ab44bda1b5e45128f3cc82c7917 Mon Sep 17 00:00:00 2001 From: akarnokd Date: Tue, 10 Dec 2019 16:10:32 +0100 Subject: [PATCH 2/4] Also disable creating snapshots for secondary branches --- gradle/buildViaTravis.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gradle/buildViaTravis.sh b/gradle/buildViaTravis.sh index 61610d131a..ea385c3e92 100755 --- a/gradle/buildViaTravis.sh +++ b/gradle/buildViaTravis.sh @@ -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 From e4bf9342df791ea500ceb13a1ca3a8de8a5d2a41 Mon Sep 17 00:00:00 2001 From: akarnokd Date: Tue, 10 Dec 2019 16:25:23 +0100 Subject: [PATCH 3/4] Fix TRAVIS_BRANCH is the same as TRAVIS_TAG for releases case --- gradle/push_javadoc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/push_javadoc.sh b/gradle/push_javadoc.sh index 4df07cd5cd..1fd1e37054 100644 --- a/gradle/push_javadoc.sh +++ b/gradle/push_javadoc.sh @@ -14,8 +14,8 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0 fi -# only when on the 3.x branch -if [ "$TRAVIS_BRANCH" != "3.x" ]; then +# 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 From 02b9d1c328531b6c562718f4a7c74b3c498e9580 Mon Sep 17 00:00:00 2001 From: akarnokd Date: Tue, 10 Dec 2019 16:47:55 +0100 Subject: [PATCH 4/4] Space needed after [ and before " --- gradle/push_javadoc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/push_javadoc.sh b/gradle/push_javadoc.sh index 1fd1e37054..c8f648258e 100644 --- a/gradle/push_javadoc.sh +++ b/gradle/push_javadoc.sh @@ -15,7 +15,7 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then fi # only when on the 3.x branch and not tagged -if ["$TRAVIS_BRANCH" != "3.x"] && [ "$TRAVIS_TAG" == "" ]; then +if [ "$TRAVIS_BRANCH" != "3.x" ] && [ "$TRAVIS_TAG" == "" ]; then echo -e "On a secondary branch '$TRAVIS_BRANCH', skipping JavaDocs pushback." exit 0 fi