forked from micrometer-metrics/micrometer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathciBuild.sh
executable file
·29 lines (25 loc) · 921 Bytes
/
ciBuild.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
#!/bin/bash
# This script will build the project.
SWITCHES="-s --console=plain"
if [ $CIRCLE_PR_NUMBER ]; then
echo -e "Build Pull Request #$CIRCLE_PR_NUMBER => Branch [$CIRCLE_BRANCH]"
./gradlew clean build $SWITCHES
elif [ -z $CIRCLE_TAG ]; then
echo -e ?'Build Branch with Snapshot => Branch ['$CIRCLE_BRANCH']'
./gradlew clean build $SWITCHES
elif [ $CIRCLE_TAG ]; then
echo -e 'Build Branch for Release => Branch ['$CIRCLE_BRANCH'] Tag ['$CIRCLE_TAG']'
case "$CIRCLE_TAG" in
*-rc\.*)
./gradlew -Prelease.disableGitChecks=true -Prelease.useLastTag=true clean build candidate $SWITCHES
;;
*)
./gradlew -Prelease.disableGitChecks=true -Prelease.useLastTag=true clean build final $SWITCHES
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$CIRCLE_BRANCH'] Tag ['$CIRCLE_TAG'] Pull Request ['$CIRCLE_PR_NUMBER']'
./gradlew clean build $SWITCHES
fi
EXIT=$?
exit $EXIT