aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/deploy_snapshot.sh16
-rw-r--r--util/settings.xml11
-rwxr-xr-xutil/update_snapshot_docs.sh25
3 files changed, 52 insertions, 0 deletions
diff --git a/util/deploy_snapshot.sh b/util/deploy_snapshot.sh
new file mode 100755
index 0000000..2a2db4c
--- /dev/null
+++ b/util/deploy_snapshot.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# see https://coderwall.com/p/9b_lfq
+
+set -e -u
+
+if [ "$TRAVIS_REPO_SLUG" == "google/jimfs" ] && \
+ [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \
+ [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
+ [ "$TRAVIS_BRANCH" == "master" ]; then
+ echo "Publishing Maven snapshot..."
+
+ mvn clean source:jar javadoc:jar deploy --settings="util/settings.xml" -DskipTests=true
+
+ echo "Maven snapshot published."
+fi
diff --git a/util/settings.xml b/util/settings.xml
new file mode 100644
index 0000000..306d14a
--- /dev/null
+++ b/util/settings.xml
@@ -0,0 +1,11 @@
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <servers>
+ <server>
+ <id>sonatype-nexus-snapshots</id>
+ <username>${env.CI_DEPLOY_USERNAME}</username>
+ <password>${env.CI_DEPLOY_PASSWORD}</password>
+ </server>
+ </servers>
+</settings>
diff --git a/util/update_snapshot_docs.sh b/util/update_snapshot_docs.sh
new file mode 100755
index 0000000..aae5fa0
--- /dev/null
+++ b/util/update_snapshot_docs.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# see http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ for details
+
+set -e -u
+
+if [ "$TRAVIS_REPO_SLUG" == "google/jimfs" ] && \
+ [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \
+ [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
+ [ "$TRAVIS_BRANCH" == "master" ]; then
+ echo "Publishing Javadoc and JDiff..."
+
+ cd $HOME
+ git clone -q -b gh-pages https://${GH_TOKEN}@github.com/google/jimfs gh-pages > /dev/null
+ cd gh-pages
+
+ git config --global user.email "travis@travis-ci.org"
+ git config --global user.name "travis-ci"
+
+ ./updaterelease.sh snapshot
+
+ git push -fq origin gh-pages > /dev/null
+
+ echo "Javadoc published to gh-pages."
+fi