forked from braintree/browser-switch-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_snapshot.sh
More file actions
24 lines (20 loc) · 870 Bytes
/
deploy_snapshot.sh
File metadata and controls
24 lines (20 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -e
SLUG="braintree/browser-switch-android"
JDK="oraclejdk8"
BRANCH="master"
if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'."
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping snapshot deployment: was pull request."
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
elif [[ $(./gradlew properties | grep versionName) != *-SNAPSHOT ]]; then
echo "Skipping snapshot deployment: not a snapshot version."
else
echo "Deploying snapshot..."
./gradlew publishToSonatype
echo "Snapshot deployed!"
fi