generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-docs.sh
executable file
·86 lines (66 loc) · 2.35 KB
/
build-docs.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Arguments
TOKEN=${1:-}
# Git information
GIT_BRANCH="master"
GIT_REPO_DOCS=DARMA-tasking.github.io
GIT_OUTPUT_FOLDER=vt_tv_docs
# Locale variables
CURRENT_DIR="$(dirname -- "$(realpath -- "$0")")" # Current directory
BUILD_DIR=${CURRENT_DIR}/build
GHPAGE=${BUILD_DIR}/${GIT_REPO_DOCS}
MCSS=${BUILD_DIR}/m.css
# Set env vars
export DOXYGEN_EXECUTABLE=$(which doxygen)
export DOXYGEN_CONFIG_IN=${CURRENT_DIR}/docs/Doxyfile.in
export DOXYGEN_CONFIG_OUT=${BUILD_DIR}/Doxyfile
export DOXYGEN_PROJECT_NAME="VT TV"
export DOXYGEN_INPUT_DIR=${CURRENT_DIR}/src/
export DOXYGEN_DOCS_DIR=${CURRENT_DIR}/docs/
export DOXYGEN_EXAMPLE_DIR=${CURRENT_DIR}/examples/
export DOXYGEN_MAIN_PAGE=${CURRENT_DIR}/docs/md/mainpage.md
export DOXYGEN_OUTPUT_DIR=${BUILD_DIR}/${GIT_OUTPUT_FOLDER}/
export VERSION_MAJOR="1"
export VERSION_MINOR="5"
export VERSION_PATCH="0"
# Create buid dir
mkdir -p ${BUILD_DIR}
# Copy Doxygen configuration files
cp ${DOXYGEN_CONFIG_IN} ${DOXYGEN_CONFIG_OUT}
cp ${DOXYGEN_CONFIG_IN}-mcss ${DOXYGEN_CONFIG_OUT}-mcss
# Replace by env variables
env | grep -E 'DOXYGEN|VERSION_|PROJECT_SOURCE_DIR|PROJECT_BINARY_DIR' | while IFS= read -r line; do
value=${line#*=}
name=${line%%=*}
valueEscape=$( echo $value | sed 's/\//\\\//g' )
# Replace @VARIBALE_NAME@ by is value
sed -i "s/@${name}@/${valueEscape}/" ${DOXYGEN_CONFIG_OUT}
done
# Go to build folder
cd ./build
# Launch Doxygen generation
${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG_OUT}
# GIT Clone m.css
git clone https://github.com/mosra/m.css
# GIT Checkout m.css on master
cd m.css
git checkout master
cd ../
# GIT Clone documentation repository
git clone --depth=1 "https://${TOKEN}@github.com/DARMA-tasking/${GIT_REPO_DOCS}"
# Copy into the documentation repository and go to the into the repository
cd "$GHPAGE"
# Change branch [dev]
git checkout -b "$GIT_BRANCH"
# Launch doxygen python script to apply style on generated documentation
"$MCSS/documentation/doxygen.py" ${DOXYGEN_CONFIG_OUT}-mcss
# Copy new docs into the documentation repository
mv "$DOXYGEN_OUTPUT_DIR" "$GHPAGE/$GIT_OUTPUT_FOLDER"
# GIT set user
git config --global user.email "[email protected]"
git config --global user.name "Jonathan Lifflander"
# GIT add the new folder documentation
git add "$GIT_OUTPUT_FOLDER"
# GIT Commit and push
git commit -m "Update $GIT_OUTPUT_FOLDER (auto-build)"
git push origin "$GIT_BRANCH" --force