forked from jina-ai/serve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-doc.sh
executable file
·48 lines (39 loc) · 1.18 KB
/
make-doc.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
#!/usr/bin/env bash
set -ex
DOC_DIR=docs
HTML_DIR=${DOC_DIR}/_build/html
cd ${DOC_DIR} && rm -rf api && pip install -r requirements.txt && make clean && cd -
# require docker installed https://github.com/pseudomuto/protoc-gen-doc
docker run --rm \
-v $(pwd)/docs/chapters/proto:/out \
-v $(pwd)/jina/proto:/protos \
pseudomuto/protoc-gen-doc --doc_opt=markdown,docs.md
cd ${DOC_DIR} && make html && cd -
if [[ $1 == "commit" ]]; then
cp ${DOC_DIR}/README.md ${HTML_DIR}/
cd ${HTML_DIR}
echo docs.jina.ai > CNAME
git init
git config --local user.email "dev-bot@jina.ai"
git config --local user.name "Jina Dev Bot"
touch .nojekyll
git add .
git commit -m "$2" -a
git status
cd -
elif [[ $1 == "release" ]]; then
cp ${DOC_DIR}/README.md ${HTML_DIR}/
cd ${HTML_DIR}
echo docs.jina.ai > CNAME
git init
git config --local user.email "dev-bot@jina.ai"
git config --local user.name "Jina Dev Bot"
touch .nojekyll
git add .
git commit -m "$2" -a # commit before tagging, otherwise throw fatal: Failed to resolve 'HEAD' as a valid ref.
git tag ${V_JINA_VERSION}
git status
cd -
elif [[ $1 == "serve" ]]; then
python -m http.server $2 -d ${HTML_DIR}
fi