forked from MorphiaOrg/morphia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish-javadoc.sh
executable file
·50 lines (46 loc) · 987 Bytes
/
publish-javadoc.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh
initWiki() {
if [ ! -d ${WIKIDIR} ]
then
echo no wiki. cloning
git clone [email protected]:mongodb/morphia.wiki.git ${WIKIDIR}
fi
}
updateIndex() {
echo "## [Current](https://rawgithub.com/wiki/mongodb/morphia/javadoc/${TAG}/apidocs/index.html)\n" > Javadoc.md
for i in `ls -t javadoc/`
do
if [ "$i" != "${TAG}" ]
then
echo "[$i](https://rawgithub.com/wiki/mongodb/morphia/javadoc/${i}/apidocs/index.html)\n" >> Javadoc.md
fi
done
}
START=`pwd`
WIKIDIR=${START}/../morphia.wiki
initWiki
select TAG in `git tag`
do
git checkout -q $TAG
echo Building javadoc
mvn -q -f morphia/pom.xml javadoc:javadoc
APIDIR=${WIKIDIR}/javadoc/${TAG}
if [ -d ${APIDIR} ]
then
cd ${APIDIR}/..
rm -r ${TAG}
fi
cd ${START}
mkdir -p ${APIDIR}
cd ${START}
cp -r morphia/target/site/apidocs ${APIDIR}
cd ${WIKIDIR}
updateIndex
git add .
git commit -a -m "adding javadoc for the ${TAG} release"
git push
cd ${START}
git checkout master
mvn clean
exit
done