Skip to content

Commit 2db37db

Browse files
committed
Deploy Javadoc to GitHub pages
[#154631313]
1 parent 5fcd92e commit 2db37db

File tree

1 file changed

+8
-37
lines changed

1 file changed

+8
-37
lines changed

deploy-javadoc.sh

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,14 @@
11
#!/usr/bin/env bash
22

3-
DEPLOY_PATH=/home/rabbitmq/extras/releases/rabbitmq-java-client/current-javadoc
4-
5-
# RSync user/host to deploy to. Mandatory.
6-
DEPLOY_USERHOST=
7-
8-
9-
# Imitate make-style variable settings as arguments
10-
while [[ $# -gt 0 ]] ; do
11-
declare "$1"
12-
shift
13-
done
14-
15-
mandatory_vars="DEPLOY_USERHOST"
16-
optional_vars="DEPLOY_PATH"
17-
18-
function die () {
19-
echo "$@" 2>&1
20-
exit 1
21-
}
22-
23-
# Check mandatory settings
24-
for v in $mandatory_vars ; do
25-
[[ -n "${!v}" ]] || die "$v not set"
26-
done
27-
28-
echo "Settings:"
29-
for v in $mandatory_vars $optional_vars ; do
30-
echo "${v}=${!v}"
31-
done
32-
33-
set -e -x
3+
DEPLOY_DIRECTORY=api/4.x.x
4+
TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))
345

356
mvn -q clean javadoc:javadoc -Dmaven.javadoc.failOnError=false
36-
37-
ssh $DEPLOY_USERHOST \
38-
"rm -rf $DEPLOY_PATH; \
39-
mkdir -p $DEPLOY_PATH"
40-
41-
rsync -rpl --exclude '*.sh' target/site/apidocs/ $DEPLOY_USERHOST:$DEPLOY_PATH
7+
git co gh-pages
8+
rm -rf $DEPLOY_DIRECTORY/*
9+
cp -r target/site/apidocs/* $DEPLOY_DIRECTORY
10+
git add $DEPLOY_DIRECTORY
11+
git commit -m "Add Javadoc for $TAG"
12+
git push origin gh-pages
4213

4314

0 commit comments

Comments
 (0)