-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpublish-docs
executable file
·48 lines (37 loc) · 982 Bytes
/
publish-docs
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
#!/bin/sh
unset IFS
set -euf
DOCS="${TRAVIS_BUILD_DIR}/docs"
PAGE_REPO="${DOCS}/_pages"
mkdir "$DOCS"
HOST_PATH="github.com/${TRAVIS_REPO_SLUG}.git"
git clone \
-b gh-pages \
"https://git@${HOST_PATH}" \
"$PAGE_REPO"
#
# Clean slate in case the net effect involves a removal of an old doc file.
#
cd "$PAGE_REPO"
find \
. \
-type f \
-not -path '*/\.*' \
-exec rm -rf "{}" \; || :
cd "$TRAVIS_BUILD_DIR"
PROJECT_BASE="$(dirname -- Doxyfile)"
PROJECT="$(readlink -f "$PROJECT_BASE")"
cd "$PROJECT"
doxygen Doxyfile
mkdir -p "${PAGE_REPO}/${PROJECT_BASE}"
cp -r html/. "${PAGE_REPO}/${PROJECT_BASE}/"
cd "$PAGE_REPO"
echo "$(date)" >README.md
git config --global push.default simple
git config user.name 'TravisCI'
git config user.email '[email protected]'
git add --force --all
git commit \
-m "Travis build: ${TRAVIS_BUILD_NUMBER}" \
-m "Commit: ${TRAVIS_COMMIT}"
git push -f "https://${GH_REPO_TOKEN}@${HOST_PATH}" 2>&1 >/dev/null