Skip to content

Commit 3e7edb9

Browse files
hubflow friendly scripts (#72)
1 parent f247c89 commit 3e7edb9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,26 @@ buildScan {
8888
}
8989

9090
def versionSuffix() {
91-
def versionSuffix = ''
91+
def versionSuffix
9292
def branchName = project.findProperty('branch');
9393
if (branchName == null) {
9494
def details = versionDetails()
9595
if (details != null) {
9696
branchName = details.branchName
9797
}
9898
}
99-
99+
/*branch*/
100100
if (branchName != null) {
101101
if (branchName == 'master') {
102+
versionSuffix = ''
103+
} else if (branchName == 'develop') {
102104
versionSuffix = '-SNAPSHOT'
103105
} else {
104106
versionSuffix = "-${branchName.replace("/", "-")}-SNAPSHOT"
105107
}
108+
/*tag*/
109+
} else {
110+
versionSuffix = ''
106111
}
107112
return versionSuffix
108113
}

ci/buildViaTravis.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
55
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
66
./gradlew -Pbranch="${TRAVIS_BRANCH}" build
77
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
8-
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
8+
echo -e 'Build Branch => Branch ['$TRAVIS_BRANCH']'
99
./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -Pbranch="${TRAVIS_BRANCH}" build artifactoryPublish --stacktrace
10-
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
11-
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
12-
./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" build bintrayUpload --stacktrace
1310
else
14-
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
15-
./gradlew -Pbranch="${TRAVIS_BRANCH}" build
11+
echo -e 'Build Tag => Tag ['$TRAVIS_TAG']'
12+
./gradlew build
1613
fi

0 commit comments

Comments
 (0)