117ce305cSVladimir Kotal#!/bin/bash 217ce305cSVladimir Kotal 317ce305cSVladimir Kotalset -e 4d57bcbe0SVladimir Kotalset -x 517ce305cSVladimir Kotal 6c34749e2SVladimir Kotalif [[ "${TRAVIS_REPO_SLUG}" != "oracle/opengrok" || 75a7a4160SVladimir Kotal "${TRAVIS_PULL_REQUEST}" != "false" || 8c34749e2SVladimir Kotal "${TRAVIS_BRANCH}" != "master" ]]; then 9*efc06f38SVladimir Kotal echo "Skipping Javadoc refresh" 10c34749e2SVladimir Kotal exit 0 11c34749e2SVladimir Kotalfi 12c34749e2SVladimir Kotal 13c34749e2SVladimir Kotalecho -e "Publishing javadoc...\n" 14c34749e2SVladimir Kotal 1586b0ab6bSAdam Hornacek./mvnw -DskipTests=true site 1617ce305cSVladimir Kotal 1717ce305cSVladimir Kotalgit config --global user.email "travis@travis-ci.org" 1817ce305cSVladimir Kotalgit config --global user.name "travis-ci" 1917ce305cSVladimir Kotalgit clone --quiet --branch=gh-pages \ 203f6b0551SVladimir Kotal https://${GH_PAGES_TOKEN}@github.com/oracle/opengrok gh-pages 2117ce305cSVladimir Kotal 2217ce305cSVladimir Kotalcd gh-pages 2317ce305cSVladimir Kotalif [[ -d ./javadoc ]]; then 2417ce305cSVladimir Kotal git rm -rf ./javadoc 2517ce305cSVladimir Kotalfi 2617ce305cSVladimir Kotalcp -Rf ${TRAVIS_BUILD_DIR}/target/site/apidocs ./javadoc 2717ce305cSVladimir Kotalgit add -f ./javadoc 2817ce305cSVladimir Kotalgit commit -m "Lastest javadoc auto-pushed to gh-pages" 2917ce305cSVladimir Kotalgit push -fq origin gh-pages 30c34749e2SVladimir Kotal 31c34749e2SVladimir Kotalecho -e "Published Javadoc to gh-pages.\n" 32