forked from square/okhttp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-deploy snapshots from Travis CI to Sonatype.
- Loading branch information
1 parent
c2e143c
commit 79d1568
Showing
4 changed files
with
55 additions
and
5 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,23 @@ | ||
#!/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/ | ||
|
||
SLUG="square/okhttp" | ||
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'." | ||
else | ||
echo "Deploying snapshot..." | ||
mvn clean source:jar javadoc:jar deploy --settings=".buildscript/settings.xml" -Dmaven.test.skip=true | ||
fi |
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,9 @@ | ||
<settings> | ||
<servers> | ||
<server> | ||
<id>sonatype-nexus-snapshots</id> | ||
<username>${env.CI_DEPLOY_USERNAME}</username> | ||
<password>${env.CI_DEPLOY_PASSWORD}</password> | ||
</server> | ||
</servers> | ||
</settings> |
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 |
---|---|---|
@@ -1,11 +1,26 @@ | ||
language: java | ||
|
||
jdk: | ||
- oraclejdk7 | ||
- oraclejdk8 | ||
|
||
after_success: | ||
- .buildscript/deploy_snapshot.sh | ||
|
||
env: | ||
global: | ||
- secure: "S0BTJVrF4fUCwhTdmoQY6LYr5r1wgXZ/p8lc5bIgUUsc1Ckalwt7s/GDwPuLJ4702sI5t56Eye2iEIMUjeFJKqebZRsX1C5oYsYFxGi3BGlepstYpmj0gLXuSWqCLniS9zmHXCxLhLkC6KxPVjhDlbq76XQx0o3K1J8oEIj/PCE=" | ||
- secure: "awV7yLXURjlPbTOladsNDZk74KYCNXoiZpAP0gQFfK4Sc0fc7+kg8z/yhdWXeTxjsIZ6m0dVDHTqnH8ytnydwXpBam8JdQJ+EAWA6R3Svq1BR1bzl/PcZUoz+Xn8lMXdU3yA1p4qtQlUhMxwsE3MOVe24HSDJPAu4XeWFj1j3qo=" | ||
|
||
branches: | ||
except: | ||
- gh-pages | ||
|
||
notifications: | ||
email: false | ||
|
||
before_install: | ||
- mvn -version | ||
sudo: false | ||
|
||
jdk: | ||
- oraclejdk7 | ||
- oraclejdk8 | ||
cache: | ||
directories: | ||
- $HOME/.m2 |
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