xref: /aosp_15_r20/external/jimfs/util/update_snapshot_docs.sh (revision 0706980374fc98e4af7ec8a17362c33fb688fed8)
1#!/bin/bash
2
3# see http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ for details
4
5set -e -u
6
7if [ "$TRAVIS_REPO_SLUG" == "google/jimfs" ] && \
8   [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \
9   [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
10   [ "$TRAVIS_BRANCH" == "master" ]; then
11  echo "Publishing Javadoc and JDiff..."
12
13  cd $HOME
14  git clone -q -b gh-pages https://${GH_TOKEN}@github.com/google/jimfs gh-pages > /dev/null
15  cd gh-pages
16
17  git config --global user.email "[email protected]"
18  git config --global user.name "travis-ci"
19
20  ./updaterelease.sh snapshot
21
22  git push -fq origin gh-pages > /dev/null
23
24  echo "Javadoc published to gh-pages."
25fi
26