Skip to content

Commit abcfbfb

Browse files
committed
Re-add deploy.sh
1 parent 8d67334 commit abcfbfb

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.gradle/deploy.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# This script will build the project.
3+
4+
SWITCHES="-s --console=plain"
5+
6+
if [ $CIRCLE_PR_NUMBER ]; then
7+
echo -e "WARN: Should not be here => Found Pull Request #$CIRCLE_PR_NUMBER => Branch [$CIRCLE_BRANCH]"
8+
echo -e "Not attempting to publish"
9+
elif [ -z $CIRCLE_TAG ]; then
10+
echo -e "Publishing Snapshot => Branch ['$CIRCLE_BRANCH']"
11+
openssl aes-256-cbc -d -in gradle.properties.enc -out gradle.properties -k "$KEY" -md sha256
12+
./gradlew snapshot $SWITCHES -x release -x test
13+
elif [ $CIRCLE_TAG ]; then
14+
echo -e "Publishing Release => Branch ['$CIRCLE_BRANCH'] Tag ['$CIRCLE_TAG']"
15+
openssl aes-256-cbc -d -in gradle.properties.enc -out gradle.properties -k "$KEY" -md sha256
16+
case "$CIRCLE_TAG" in
17+
*-rc\.*)
18+
./gradlew -Prelease.disableGitChecks=true -Prelease.useLastTag=true candidate bintrayPublish $SWITCHES -x release -x artifactoryPublish
19+
;;
20+
*)
21+
./gradlew -Prelease.disableGitChecks=true -Prelease.useLastTag=true final bintrayPublish $SWITCHES -x release -x artifactoryPublish
22+
;;
23+
esac
24+
else
25+
echo -e "WARN: Should not be here => Branch ['$CIRCLE_BRANCH'] Tag ['$CIRCLE_TAG'] Pull Request ['$CIRCLE_PR_NUMBER']"
26+
echo -e "Not attempting to publish"
27+
fi
28+
29+
EXIT=$?
30+
31+
exit $EXIT

0 commit comments

Comments
 (0)