1 # see http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ for details 2 3 if [ "$TRAVIS_REPO_SLUG" == "google/dagger" ] && \ 4 [ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \ 5 [ "$TRAVIS_PULL_REQUEST" == "false" ] && \ 6 [ "$TRAVIS_BRANCH" == "master" ]; then 7 echo -e "Publishing javadoc...\n" 8 mvn javadoc:aggregate -P!examples 9 TARGET="$(pwd)/target" 10 11 cd $HOME 12 git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/google/dagger gh-pages > /dev/null 13 14 cd gh-pages 15 git config --global user.email "travis (at] travis-ci.org" 16 git config --global user.name "travis-ci" 17 git rm -rf api/latest 18 mkdir -p api 19 mv ${TARGET}/site/apidocs api/latest 20 git add -f api/latest 21 git commit -m "Lastest javadoc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages" 22 git push -fq origin gh-pages > /dev/null 23 24 echo -e "Published Javadoc to gh-pages.\n" 25 fi 26