2017-02-07 15:35:41 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.
|
|
|
|
#
|
|
|
|
# Adapted from https://coderwall.com/p/9b_lfq and
|
|
|
|
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
|
|
|
|
|
2019-12-10 18:48:43 +00:00
|
|
|
SLUG="dropbox/Store"
|
2017-02-07 15:35:41 +00:00
|
|
|
JDK="oraclejdk8"
|
2019-12-10 18:48:43 +00:00
|
|
|
BRANCH="master"
|
2017-02-07 15:35:41 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
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'."
|
|
|
|
else
|
|
|
|
echo "Deploying snapshot..."
|
|
|
|
./gradlew uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}"
|
|
|
|
echo "Snapshot deployed!"
|
|
|
|
fi
|