diff --git a/build-docs.sh b/build-docs.sh new file mode 100755 index 0000000000000000000000000000000000000000..1ce09d8a0c2facb42d9aea71a43b08847a07e0fd --- /dev/null +++ b/build-docs.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Local build verification + +# cleanup and create a virtual python directory for docs command executions. +cleanup +mkdir -p ~/docs_jjb/virtualpython +virtualenv -p /usr/bin/python3 ~/docs_jjb/virtualpython +source ~/docs_jjb/virtualpython/bin/activate +exit_if_error $? "Unable to activate virtual python." + +# Tool installation and html generation +pip install sphinx +exit_if_error $? "sphinx installation failed." + +pip install recommonmark +exit_if_error $? "recommonmark installation failed." + +pip install sphinx_markdown_tables +exit_if_error $? "sphinx_rtd_theme installation failed." +sphinx_markdown_tables +pip install sphinx_rtd_theme +exit_if_error $? "sphinx_rtd_theme installation failed." + +pip install -r requirements.txt +exit_if_error $? "Running requirements.txt failed." + +make html +exit_if_error $? "Unable to generate Chinese HTML documents." + +sphinx-build -b gettext . _build/gettext +exit_if_error $? "Unable to generate .pot documents." + +sphinx-intl update -p _build/gettext -l en --line-width=99999999999999999999 +exit_if_error $? "Unable to generate .po documents." + +sphinx-build -b html -D language=en . _build/html/en +exit_if_error $? "Unable to generate English HTML documents." + +mkdir -p /var/opt/docs +mkdir /var/opt/docs/$BUILD_NUMBER +cp -r /root/docs/_build/html/en/* /var/opt/docs/$BUILD_NUMBER/ + +# Cleanup and exit +cleanup diff --git a/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Contribution.po b/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Contribution.po index d5b28b65aa16b225832da7dfd19e735c1bd5d235..a70c6cc258156c87a5b3a50519e73c64c14db3c4 100644 --- a/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Contribution.po +++ b/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Contribution.po @@ -191,7 +191,7 @@ msgstr "Operating guidance" #: ../../Projects/APPSTORE/AppStore_Contribution.md:96 msgid "AppStore是开发者发布和上线App应用的市场,由Developer平台开发的边缘应用,经过测试可以直接分享到AppStore应用商店。也可直接上传符合平台规范的应用包,应用包文件类型为csar。一个APP对应多个Package,使用者可直接下载APP的最新版本Package或者下载指定版本的Package。" -msgstr "AppStore is a market for developers publishing and onboarding App applications, edge applications developed by Developer Platform and tested can be shared directly to the AppStore app store.It is also possible to directly upload an application package that conforms to the platform specification and the application package document type is csr. One APP corresponds to multiple packages, the user can download the latest version of the APP directly or download the specified version of Package." +msgstr "AppStore is a market for developers publishing and onboarding App applications, edge applications developed by Developer Platform and tested can be shared directly to the AppStore .It is also possible to directly upload an application package that conforms to the platform specification and the application package document type is csar. One APP corresponds to multiple packages, the user can download the latest version of the APP directly or download the specified version of Package." #: ../../Projects/APPSTORE/AppStore_Contribution.md:98 msgid "登录应用平台" diff --git a/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Interfaces.po b/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Interfaces.po index 56d89e28cea26bfc3610de5567fb93fe755a7c47..4a7e8aeb6681a6b6fc67351769b638dbc4dbaaa6 100644 --- a/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Interfaces.po +++ b/locale/en/LC_MESSAGES/Projects/APPSTORE/AppStore_Interfaces.po @@ -23,7 +23,7 @@ msgstr "Interface design" #: ../../Projects/APPSTORE/AppStore_Interfaces.md:3 msgid "文档中介绍了appstore-be模块的接口设计详情,共有六个部分,分别对应于app管理、包管理、评论管理、应用推送、仓库管理、消息中心。" -msgstr "The document describes the interface design details for the appstore-be module, with a total of six parts, which correspond to app management, packet management, comment management, application push, warehouse management, and message center." +msgstr "The document describes the interface design details for the appstore-be module, with a total of six parts, which correspond to app management, packet management, comment management, application push, warehouse management and message center." #: ../../Projects/APPSTORE/AppStore_Interfaces.md:5 msgid "[AppStore 接口列表](#接口列表)" diff --git a/locale/en/LC_MESSAGES/Projects/MEP/MEP_agent_Contribution.po b/locale/en/LC_MESSAGES/Projects/MEP/MEP_agent_Contribution.po index 99bee1095ee5aab6754f5fa2c700b39aca0ce732..39968d22be5c87f756042fe74a98bb26d671a421 100644 --- a/locale/en/LC_MESSAGES/Projects/MEP/MEP_agent_Contribution.po +++ b/locale/en/LC_MESSAGES/Projects/MEP/MEP_agent_Contribution.po @@ -31,7 +31,7 @@ msgstr "Build local development environment" #: ../../Projects/MEP/MEP_agent_Contribution.md:8 msgid "This section will guide developers to build mep-agent module locally and help developers to quickly understand and develop code" -msgstr "This section will guide developers to build mep-agent module locally and help developers to quickly under and develop code" +msgstr "This section will guide developers to build mep-agent module locally and help developers to quickly understand and develop code" #: ../../Projects/MEP/MEP_agent_Contribution.md:11 msgid "Clone mep-agent code" diff --git a/setup-docs-env.sh b/setup-docs-env.sh new file mode 100755 index 0000000000000000000000000000000000000000..e0d700841561c5194acc108a2b1ae93c6c34c1a2 --- /dev/null +++ b/setup-docs-env.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# Env setup for local build + +# Common function for exit function +exit_if_error() { + local exit_code=$1 + shift + [[ $exit_code ]] && + ((exit_code != 0)) && { + printf 'ERROR: %s\n' "$@" >&2 + } +} + +# Common clean up function +cleanup() { + rm -rf ~/docs_jjb +} + +# Cleanup signal on every exit +trap cleanup EXIT + +# Initial cleanup +cleanup + +unfilteredver="(python3 -V)" +# Getting the environment's running python3 version +currentver="$(sed 's/[[:alpha:][:space:]]//g' <<< "$unfilteredver")" +requiredver="3.7.9" + +# Condition to exit script on lower versions, and continue on equal or higher versions of python3.7.9 +if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then + echo "Existing python version is greater than or equal to ${requiredver}" +else + echo "Existing python version is less than ${requiredver}" + exit 1 +fi + +# Getting the environment's running virtualenv version +curvirtualenvver="$(virtualenv --version)" +novirtualenvver="0.0.0" + +# Condition to check if virtualenv is installed, if not, to install latest version of it +if [ "$(printf '%s\n' "$novirtualenvver" "$curvirtualenvver" | sort -V | head -n1)" = "$novirtualenvver" ]; then + echo "python-virtualenv is installed" +else + echo "python-virtualenv installation begins" + sudo apt-get update + sudo apt-get install python-virtualenv -y + exit_if_error $? "Unable to install python-virtualenv." +fi + +lighttpd -v + +if [ $? -eq 0 ]; then + echo "lighttpd INSTALLED" +else + echo "lighttpd IS NOT INSTALLED, IT WILL BE INSTALLED NOW" + sudo apt install lighttpd -y + sudo systemctl start lighttpd + sudo systemctl enable lighttpd + sudo systemctl status lighttpd + #verify lighttpd + cm=$(lighttpd -v) + + echo -e "$cm" +fi