Skip to content

Commit

Permalink
Adds travis configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Håkansson committed Jun 18, 2016
1 parent d98d828 commit b21dfee
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: java
jdk: oraclejdk7
after_success:
- ./upload.sh
38 changes: 38 additions & 0 deletions upload.sh
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



0 comments on commit b21dfee

Please sign in to comment.