File: generate-latest-docs.sh

package info (click to toggle)
guice 4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,620 kB
  • ctags: 9,493
  • sloc: xml: 60,913; java: 54,700; sh: 119; jsp: 12; makefile: 10
file content (30 lines) | stat: -rwxr-xr-x 1,236 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# see http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ for details

if [ "$TRAVIS_REPO_SLUG" == "google/guice" ] && \
   [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && \
   [ "$LABEL" == "ant" ] && \
   [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
   [ "$TRAVIS_BRANCH" == "master" ]; then
  echo -e "Publishing javadoc & JDiff...\n"
  rm -rf build/docs
  ant javadoc jdiff
  cp -R build/docs/javadoc $HOME/javadoc-latest
  cp -R build/docs/latest-api-diffs $HOME/api-diffs-latest
  cp lib/build/jdiff/*.gif $HOME/api-diffs-latest/

  cd $HOME
  git config --global user.email "travis@travis-ci.org"
  git config --global user.name "travis-ci"
  git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/google/guice gh-pages > /dev/null
  
  cd gh-pages
  git rm -rf api-docs/latest/api-diffs api-docs/latest/javadoc
  mkdir -p api-docs/latest
  cp -rf $HOME/api-diffs-latest api-docs/latest/api-diffs
  cp -rf $HOME/javadoc-latest api-docs/latest/javadoc
  git add -f .
  git commit -m "Lastest javadoc & api-diffs on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages"
  git push -fq origin gh-pages > /dev/null

  echo -e "Published Javadoc & JDiff to gh-pages.\n"
fi