-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joel Håkansson
committed
Jun 18, 2016
1 parent
d98d828
commit b21dfee
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
language: java | ||
jdk: oraclejdk7 | ||
after_success: | ||
- ./upload.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/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 | ||
|
||
|
||
|