forked from tarantool/doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_submodules.sh
executable file
·95 lines (72 loc) · 3.3 KB
/
build_submodules.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
87
88
89
90
91
92
93
94
95
#!/bin/bash
set -xe -o pipefail -o nounset
project_root=$(pwd)
# Translations
po_dest="${project_root}/locale/ru/LC_MESSAGES"
# Copy Building Tarantool Docs guide
cp README.rst doc/contributing/docs/_includes/README.rst
# Cartridge
cartridge_root="${project_root}/modules/cartridge"
# Build Cartridge to extract docs
cd "${cartridge_root}" || exit
CMAKE_DUMMY_WEBUI=true tarantoolctl rocks make
# Copy Cartridge docs, including diagrams and images
cartridge_rst_src="${cartridge_root}/build.luarocks/build.rst"
cartridge_rst_dest="${project_root}/doc/book/cartridge"
cd "${cartridge_rst_src}" || exit
mkdir -p "${cartridge_rst_dest}"
find . -iregex '.*\.\(rst\|png\|puml\|svg\)$' -exec cp -r --parents {} "${cartridge_rst_dest}" \;
# Copy translation templates
cartridge_pot_src="${cartridge_root}/build.luarocks/build.rst/locale"
cartridge_pot_dest="${project_root}/locale/book/cartridge"
cd "${cartridge_pot_src}" || exit
mkdir -p "${cartridge_pot_dest}"
find . -name '*.pot' -exec cp -rv --parents {} "${cartridge_pot_dest}" \;
# Copy translations
cartridge_po_src="${cartridge_root}/build.luarocks/build.rst/locale/ru/LC_MESSAGES"
cartridge_po_dest="${po_dest}/book/cartridge"
cd "${cartridge_po_src}" || exit
mkdir -p "${cartridge_po_dest}"
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_po_dest}" \;
# Cartridge CLI
cartridge_cli_root="${project_root}/modules/cartridge-cli/doc"
cartridge_cli_dest="${cartridge_rst_dest}/cartridge_cli"
cartridge_cli_po_dest="${po_dest}/book/cartridge/cartridge_cli"
# Copy Cartridge CLI docs, including diagrams and images
mkdir -p "${cartridge_cli_dest}"
cd ${cartridge_cli_root} || exit
find . -iregex '.*\.\(rst\|png\|puml\|svg\)$' -exec cp -rv --parents {} "${cartridge_cli_dest}" \;
# Copy translations
mkdir -p "${cartridge_cli_po_dest}"
cd "${cartridge_cli_root}/locale/ru/LC_MESSAGES/doc/" || exit
find . -name '*.po' -exec cp -rv --parents {} "${cartridge_cli_po_dest}" \;
# Monitoring
monitoring_root="${project_root}/modules/metrics/doc/monitoring"
monitoring_dest="${project_root}/doc/book"
monitoring_grafana_root="${project_root}/modules/grafana-dashboard/doc/monitoring"
# Copy monitoring docs to the right destination
mkdir -p "${monitoring_dest}"
cp -rfv "${monitoring_root}" "${monitoring_dest}/"
cp -rfv "${monitoring_grafana_root}" "${monitoring_dest}/"
# Luatest
luatest_root="${project_root}/modules/luatest"
luatest_dest="${project_root}/doc/reference/reference_rock/luatest"
# Generate Luatest docs
cd "${luatest_root}"
ldoc --ext=rst --dir=rst --toctree="API" .
# Copy Luatest docs to the right place
cd "${luatest_dest}"
cp -fa "${luatest_root}/rst/." "${luatest_dest}"
cp "${luatest_root}/README.rst" "${luatest_dest}"
mkdir -p "${luatest_dest}/_includes/"
mv -fv "${luatest_dest}/index.rst" "${luatest_dest}/_includes/"
# Tarantool C++ connector
tntcxx_root="${project_root}/modules/tntcxx"
tntcxx_howto_dest="${project_root}/doc/how-to"
tntcxx_api_dest="${project_root}/doc/book/connectors"
# Copy Tarantool C++ connector docs to the right places
mkdir -p "${tntcxx_api_dest}/cxx/"
mkdir -p "${tntcxx_howto_dest}/_includes"
cp -rfv "${tntcxx_root}/doc/tntcxx_getting_started.rst" "${tntcxx_howto_dest}/getting_started_cxx.rst"
cp -rfv "${tntcxx_root}/examples/" "${tntcxx_howto_dest}/_includes/examples/"
cp -rfv "${tntcxx_root}/doc/tntcxx_api.rst" "${tntcxx_api_dest}/cxx/"