You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
920 B
26 lines
920 B
# see http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ for details
|
|
|
|
if [ "$TRAVIS_REPO_SLUG" == "google/auto" ] && \
|
|
[ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \
|
|
[ "$TRAVIS_PULL_REQUEST" == "false" ] && \
|
|
[ "$TRAVIS_BRANCH" == "master" ]; then
|
|
echo -e "Publishing javadoc...\n"
|
|
|
|
mvn -f build-pom.xml javadoc:aggregate
|
|
TARGET="$(pwd)/target"
|
|
|
|
cd $HOME
|
|
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/google/auto gh-pages > /dev/null
|
|
|
|
cd gh-pages
|
|
git config --global user.email "travis@travis-ci.org"
|
|
git config --global user.name "travis-ci"
|
|
git rm -rf api/latest
|
|
mv ${TARGET}/site/apidocs api/latest
|
|
git add -A -f api/latest
|
|
git commit -m "Latest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages"
|
|
git push -fq origin gh-pages > /dev/null
|
|
|
|
echo -e "Published Javadoc to gh-pages.\n"
|
|
fi
|