forked from brailleapps/braille-utils.api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload.sh
executable file
·38 lines (32 loc) · 884 Bytes
/
upload.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
34
35
#!/bin/bash
branch=$TRAVIS_BRANCH
if [ -z "$branch" ]; then
branch=`git rev-parse --abbrev-ref HEAD`
fi
revision=`git rev-parse HEAD`
pullrequest=$TRAVIS_PULL_REQUEST
if [ -z "$pullrequest" ]; then
pullrequest="false"
fi
echo "Branch: $branch"
echo "Revision: $revision"
echo "Pull request: $pullrequest"
if [ "$pullrequest" = "false" ]; then
if [ $branch = "master" ]; then
echo "On master branch."
if [ -n "$SONATYPE_USER" ]; then
if [ -n "$SONATYPE_PASSWORD" ]; then
echo "Starting upload..."
./gradlew uploadArchives -PsonatypeUsername=$SONATYPE_USER -PsonatypePassword=$SONATYPE_PASSWORD -PrepositoryRevision=$revision
else
echo "SONATYPE_PASSWORD not set. Skipping upload."
fi
else
echo "SONATYPE_USER not set. Skipping upload."
fi
else
echo "Not on master branch. Skipping upload."
fi
else
echo "Pull request. Skipping upload."
fi