Commit c1afdc8d authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

travis-doxygen.sh: allow overriding GitHub repo from environment

parent 2875b576
...@@ -9,6 +9,7 @@ env: ...@@ -9,6 +9,7 @@ env:
- CONF=debug - CONF=debug
- CONF=release - CONF=release
global: global:
- GITHUB_REPO='miloyip/rapidjson'
# prepare for 32/64 bit multi-arch support # prepare for 32/64 bit multi-arch support
- BITS=64 - BITS=64
- secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk=" - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk="
......
...@@ -10,8 +10,8 @@ DOXYGEN_TAR=${DOXYGEN_VER}.linux.bin.tar.gz ...@@ -10,8 +10,8 @@ DOXYGEN_TAR=${DOXYGEN_VER}.linux.bin.tar.gz
DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/${DOXYGEN_TAR}" DOXYGEN_URL="http://ftp.stack.nl/pub/users/dimitri/${DOXYGEN_TAR}"
DOXYGEN_BIN="/usr/local/bin/doxygen" DOXYGEN_BIN="/usr/local/bin/doxygen"
GHPAGES_REPO="miloyip/rapidjson" : ${GITHUB_REPO:="miloyip/rapidjson"}
GHPAGES_URL="https://github.com/${GHPAGES_REPO}" GITHUB_URL="https://github.com/${GITHUB_REPO}"
skip() { skip() {
echo "$@" 1>&2 echo "$@" 1>&2
...@@ -61,7 +61,7 @@ gh_pages_prepare() ...@@ -61,7 +61,7 @@ gh_pages_prepare()
cd "${TRAVIS_BUILD_DIR}/doc"; cd "${TRAVIS_BUILD_DIR}/doc";
[ ! -d "html" ] || \ [ ! -d "html" ] || \
abort "Doxygen target directory already exists." abort "Doxygen target directory already exists."
git clone --single-branch -b gh-pages ${GHPAGES_URL} html git clone --single-branch -b gh-pages ${GITHUB_URL} html
cd html cd html
# setup git config (with defaults) # setup git config (with defaults)
git config user.name "${GIT_NAME-travis}" git config user.name "${GIT_NAME-travis}"
...@@ -90,7 +90,7 @@ gh_pages_push() { ...@@ -90,7 +90,7 @@ gh_pages_push() {
cd "${TRAVIS_BUILD_DIR}/doc/html"; cd "${TRAVIS_BUILD_DIR}/doc/html";
# setup credentials (hide in "set -x" mode) # setup credentials (hide in "set -x" mode)
git config core.askpass 'bash -c ":"' git config core.askpass 'bash -c ":"'
( set +x ; git config credential.${GHPAGES_URL}.username "${GH_TOKEN}" ) ( set +x ; git config credential.${GITHUB_URL}.username "${GH_TOKEN}" )
# push to GitHub # push to GitHub
git push origin gh-pages || \ git push origin gh-pages || \
skip "GitHub pages update failed, temporarily ignored." skip "GitHub pages update failed, temporarily ignored."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment