forked from google/guice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-latest-docs.sh
executable file
·30 lines (26 loc) · 1.21 KB
/
generate-latest-docs.sh
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" == "oraclejdk7" ] && \
[ "$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 "[email protected]"
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