-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildtravis.sh
executable file
·33 lines (32 loc) · 1.54 KB
/
buildtravis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
echo -e "TRAVIS_BRANCH=$TRAVIS_BRANCH"
echo -e "TRAVIS_TAG=$TRAVIS_TAG"
echo -e "TRAVIS_COMMIT=${TRAVIS_COMMIT::7}"
echo -e "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
# Pull Request
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
export ORG_GRADLE_PROJECT_tagLatest=false
./gradlew clean build test distZip --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "develop" ] && [ "$TRAVIS_TAG" == "" ]; then
# Develop Branch
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
export ORG_GRADLE_PROJECT_commitHash=${TRAVIS_COMMIT::7}
export ORG_GRADLE_PROJECT_tagLatest=false
./gradlew clean build test distZip pushImage --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [[ "$TRAVIS_BRANCH" == release/* ]] && [ "$TRAVIS_TAG" == "" ]; then
# Release Branch
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH']'
export ORG_GRADLE_PROJECT_tagLatest=false
./gradlew clean build test distZip pushImage --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
# Master Branch
echo -e 'Build Master for Release => Branch ['$TRAVIS_BRANCH']'
export ORG_GRADLE_PROJECT_tagLatest=true
./gradlew clean build test distZip pushImage --stacktrace
else
# Feature Branch
echo -e 'Build Branch => Branch ['$TRAVIS_BRANCH']'
export ORG_GRADLE_PROJECT_tagLatest=false
./gradlew clean build test distZip --stacktrace
fi