Skip to content

Commit b59b9fa

Browse files
author
Vladimir Kotal
committed
use variable for branch name
1 parent 07c93c0 commit b59b9fa

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dev/javadoc.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@ if [[ "${TRAVIS_REPO_SLUG}" != "oracle/opengrok" ||
1010
exit 0
1111
fi
1212

13-
echo -e "Publishing javadoc...\n"
13+
BRANCH="gh-pages"
14+
echo -e "Publishing javadoc to $BRANCH...\n"
1415

1516
./mvnw -DskipTests=true site
1617

1718
git config --global user.email "[email protected]"
1819
git config --global user.name "travis-ci"
19-
git clone --quiet --branch=gh-pages \
20-
https://${GH_PAGES_TOKEN}@github.com/oracle/opengrok gh-pages
20+
git clone --quiet --branch=$BRANCH \
21+
https://${GH_PAGES_TOKEN}@github.com/oracle/opengrok "$BRANCH"
2122

22-
cd gh-pages
23+
cd "$BRANCH"
2324
if [[ -d ./javadoc ]]; then
2425
git rm -rf ./javadoc
2526
fi
2627
cp -Rf ${TRAVIS_BUILD_DIR}/target/site/apidocs ./javadoc
2728
git add -f ./javadoc
28-
git commit -m "Lastest javadoc auto-pushed to gh-pages"
29-
git push -fq origin gh-pages
29+
git commit -m "Lastest javadoc auto-pushed to branch $BRANCH"
30+
git push -fq origin "$BRANCH"
3031

31-
echo -e "Published Javadoc to gh-pages.\n"
32+
echo -e "Published Javadoc to branch $BRANCH.\n"

0 commit comments

Comments
 (0)