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 9c34749e2SVladimir Kotal exit 0 10c34749e2SVladimir Kotalfi 11c34749e2SVladimir Kotal 12c34749e2SVladimir Kotalecho -e "Publishing javadoc...\n" 13c34749e2SVladimir Kotal 14*86b0ab6bSAdam Hornacek./mvnw -DskipTests=true site 1517ce305cSVladimir Kotal 1617ce305cSVladimir Kotalgit config --global user.email "travis@travis-ci.org" 1717ce305cSVladimir Kotalgit config --global user.name "travis-ci" 1817ce305cSVladimir Kotalgit clone --quiet --branch=gh-pages \ 193f6b0551SVladimir Kotal https://${GH_PAGES_TOKEN}@github.com/oracle/opengrok gh-pages 2017ce305cSVladimir Kotal 2117ce305cSVladimir Kotalcd gh-pages 2217ce305cSVladimir Kotalif [[ -d ./javadoc ]]; then 2317ce305cSVladimir Kotal git rm -rf ./javadoc 2417ce305cSVladimir Kotalfi 2517ce305cSVladimir Kotalcp -Rf ${TRAVIS_BUILD_DIR}/target/site/apidocs ./javadoc 2617ce305cSVladimir Kotalgit add -f ./javadoc 2717ce305cSVladimir Kotalgit commit -m "Lastest javadoc auto-pushed to gh-pages" 2817ce305cSVladimir Kotalgit push -fq origin gh-pages 29c34749e2SVladimir Kotal 30c34749e2SVladimir Kotalecho -e "Published Javadoc to gh-pages.\n" 31