未验证 提交 9ce15470 编写于 作者: Z Zhiyu Yang 提交者: GitHub

[TS-409]<release>: OEM packaging scripts (#8174)

* [TS-409]<release>: OEM packaging scripts

* email change
上级 7e0e795c
...@@ -192,6 +192,11 @@ else ...@@ -192,6 +192,11 @@ else
allocator_macro="" allocator_macro=""
fi fi
if [[ "$dbName" == "pro" ]]; then
sed -i "s/taos config/prodb config/g" ${top_dir}/src/util/src/tconfig.c
fi
# check support cpu type # check support cpu type
if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]] ; then if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "mips64" ]] ; then
if [ "$verMode" != "cluster" ]; then if [ "$verMode" != "cluster" ]; then
......
...@@ -1002,6 +1002,7 @@ function install_TDengine() { ...@@ -1002,6 +1002,7 @@ function install_TDengine() {
echo echo
echo -e "\033[44;32;1mTDengine client is installed successfully!${NC}" echo -e "\033[44;32;1mTDengine client is installed successfully!${NC}"
fi fi
touch ~/.taos_history touch ~/.taos_history
rm -rf $(tar -tf taos.tar.gz) rm -rf $(tar -tf taos.tar.gz)
} }
......
...@@ -154,9 +154,9 @@ function install_main_path() { ...@@ -154,9 +154,9 @@ function install_main_path() {
${csudo} mkdir -p ${install_main_dir} ${csudo} mkdir -p ${install_main_dir}
${csudo} mkdir -p ${install_main_dir}/cfg ${csudo} mkdir -p ${install_main_dir}/cfg
${csudo} mkdir -p ${install_main_dir}/bin ${csudo} mkdir -p ${install_main_dir}/bin
${csudo} mkdir -p ${install_main_dir}/connector # ${csudo} mkdir -p ${install_main_dir}/connector
${csudo} mkdir -p ${install_main_dir}/driver ${csudo} mkdir -p ${install_main_dir}/driver
${csudo} mkdir -p ${install_main_dir}/examples # ${csudo} mkdir -p ${install_main_dir}/examples
${csudo} mkdir -p ${install_main_dir}/include ${csudo} mkdir -p ${install_main_dir}/include
${csudo} mkdir -p ${install_main_dir}/init.d ${csudo} mkdir -p ${install_main_dir}/init.d
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
...@@ -779,10 +779,10 @@ function update_prodb() { ...@@ -779,10 +779,10 @@ function update_prodb() {
install_log install_log
install_header install_header
install_lib install_lib
if [ "$pagMode" != "lite" ]; then # if [ "$pagMode" != "lite" ]; then
install_connector # install_connector
fi # fi
install_examples # install_examples
if [ -z $1 ]; then if [ -z $1 ]; then
install_bin install_bin
install_service install_service
...@@ -853,10 +853,10 @@ function install_prodb() { ...@@ -853,10 +853,10 @@ function install_prodb() {
install_header install_header
install_lib install_lib
install_jemalloc install_jemalloc
if [ "$pagMode" != "lite" ]; then # if [ "$pagMode" != "lite" ]; then
install_connector # install_connector
fi # fi
install_examples # install_examples
if [ -z $1 ]; then # install service and client if [ -z $1 ]; then # install service and client
# For installing new # For installing new
......
...@@ -24,7 +24,7 @@ build_dir="${compile_dir}/build" ...@@ -24,7 +24,7 @@ build_dir="${compile_dir}/build"
code_dir="${top_dir}/src" code_dir="${top_dir}/src"
release_dir="${top_dir}/release" release_dir="${top_dir}/release"
#package_name='linux' # package_name='linux'
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
install_dir="${release_dir}/ProDB-enterprise-server-${version}" install_dir="${release_dir}/ProDB-enterprise-server-${version}"
else else
...@@ -45,19 +45,13 @@ nginx_dir="${code_dir}/../../enterprise/src/plugins/web" ...@@ -45,19 +45,13 @@ nginx_dir="${code_dir}/../../enterprise/src/plugins/web"
mkdir -p ${install_dir} mkdir -p ${install_dir}
mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg
#mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
mkdir -p ${install_dir}/bin mkdir -p ${install_dir}/bin
# bin
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taosd strip ${build_dir}/bin/taosd
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs
cp ${script_dir}/remove_pro.sh ${install_dir}/bin
else else
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs
cp ${script_dir}/remove_pro.sh ${install_dir}/bin
cp ${build_dir}/bin/taosdemo ${install_dir}/bin/prodemo cp ${build_dir}/bin/taosdemo ${install_dir}/bin/prodemo
cp ${build_dir}/bin/taosdump ${install_dir}/bin/prodump cp ${build_dir}/bin/taosdump ${install_dir}/bin/prodump
cp ${build_dir}/bin/tarbitrator ${install_dir}/bin cp ${build_dir}/bin/tarbitrator ${install_dir}/bin
...@@ -66,8 +60,12 @@ else ...@@ -66,8 +60,12 @@ else
cp ${script_dir}/startPre.sh ${install_dir}/bin cp ${script_dir}/startPre.sh ${install_dir}/bin
cp ${script_dir}/taosd-dump-cfg.gdb ${install_dir}/bin cp ${script_dir}/taosd-dump-cfg.gdb ${install_dir}/bin
fi fi
cp ${build_dir}/bin/taos ${install_dir}/bin/prodbc
cp ${build_dir}/bin/taosd ${install_dir}/bin/prodbs
cp ${script_dir}/remove_pro.sh ${install_dir}/bin
chmod a+x ${install_dir}/bin/* || : chmod a+x ${install_dir}/bin/* || :
# cluster
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove_pro.sh >> remove_prodb_temp.sh sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove_pro.sh >> remove_prodb_temp.sh
mv remove_prodb_temp.sh ${install_dir}/bin/remove_pro.sh mv remove_prodb_temp.sh ${install_dir}/bin/remove_pro.sh
...@@ -84,14 +82,9 @@ if [ "$verMode" == "cluster" ]; then ...@@ -84,14 +82,9 @@ if [ "$verMode" == "cluster" ]; then
sed -i -e 's/<th style="font-weight: normal">taosd<\/th>/<th style="font-weight: normal">prodbs<\/th>/g' ${install_dir}/nginxd/admin/monitor.html sed -i -e 's/<th style="font-weight: normal">taosd<\/th>/<th style="font-weight: normal">prodbs<\/th>/g' ${install_dir}/nginxd/admin/monitor.html
sed -i -e "s/data:\['taosd', 'system'\],/data:\['prodbs', 'system'\],/g" ${install_dir}/nginxd/admin/monitor.html sed -i -e "s/data:\['taosd', 'system'\],/data:\['prodbs', 'system'\],/g" ${install_dir}/nginxd/admin/monitor.html
sed -i -e "s/name: 'taosd',/name: 'prodbs',/g" ${install_dir}/nginxd/admin/monitor.html sed -i -e "s/name: 'taosd',/name: 'prodbs',/g" ${install_dir}/nginxd/admin/monitor.html
sed -i "s/TDengine/ProDB/g" ${install_dir}/nginxd/admin/*.html sed -i "s/TDengine/ProDB/g" ${install_dir}/nginxd/admin/*.html
sed -i "s/TDengine/ProDB/g" ${install_dir}/nginxd/admin/js/*.js sed -i "s/TDengine/ProDB/g" ${install_dir}/nginxd/admin/js/*.js
sed -i '/dataDir/ {s/taos/ProDB/g}' ${install_dir}/cfg/taos.cfg
sed -i '/logDir/ {s/taos/ProDB/g}' ${install_dir}/cfg/taos.cfg
sed -i "s/TDengine/ProDB/g" ${install_dir}/cfg/taos.cfg
if [ "$cpuType" == "aarch64" ]; then if [ "$cpuType" == "aarch64" ]; then
cp -f ${install_dir}/nginxd/sbin/arm/64bit/nginx ${install_dir}/nginxd/sbin/ cp -f ${install_dir}/nginxd/sbin/arm/64bit/nginx ${install_dir}/nginxd/sbin/
elif [ "$cpuType" == "aarch32" ]; then elif [ "$cpuType" == "aarch32" ]; then
...@@ -100,6 +93,13 @@ if [ "$verMode" == "cluster" ]; then ...@@ -100,6 +93,13 @@ if [ "$verMode" == "cluster" ]; then
rm -rf ${install_dir}/nginxd/sbin/arm rm -rf ${install_dir}/nginxd/sbin/arm
fi fi
sed -i '/dataDir/ {s/taos/ProDB/g}' ${install_dir}/cfg/taos.cfg
sed -i '/logDir/ {s/taos/ProDB/g}' ${install_dir}/cfg/taos.cfg
sed -i "s/TDengine/ProDB/g" ${install_dir}/cfg/taos.cfg
sed -i "s/support@taosdata.com/support@hanatech.com.cn/g" ${install_dir}/cfg/taos.cfg
sed -i "s/taos client/prodbc/g" ${install_dir}/cfg/taos.cfg
sed -i "s/taosd/prodbs/g" ${install_dir}/cfg/taos.cfg
cd ${install_dir} cd ${install_dir}
tar -zcv -f prodb.tar.gz * --remove-files || : tar -zcv -f prodb.tar.gz * --remove-files || :
exitcode=$? exitcode=$?
...@@ -115,58 +115,62 @@ if [ "$verMode" == "cluster" ]; then ...@@ -115,58 +115,62 @@ if [ "$verMode" == "cluster" ]; then
mv install_prodb_temp.sh ${install_dir}/install_pro.sh mv install_prodb_temp.sh ${install_dir}/install_pro.sh
fi fi
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
sed 's/pagMode=full/pagMode=lite/g' ${install_dir}/install.sh >> install_prodb_temp.sh sed -e "s/pagMode=full/pagMode=lite/g" -e "s/taos_history/prodb_history/g" ${install_dir}/install.sh >> install_prodb_temp.sh
mv install_prodb_temp.sh ${install_dir}/install_pro.sh mv install_prodb_temp.sh ${install_dir}/install_pro.sh
fi fi
sed -i "/install_connector$/d" ${install_dir}/install_pro.sh
sed -i "/install_examples$/d" ${install_dir}/install_pro.sh
chmod a+x ${install_dir}/install_pro.sh chmod a+x ${install_dir}/install_pro.sh
# Copy example code # Copy example code
mkdir -p ${install_dir}/examples #mkdir -p ${install_dir}/examples
examples_dir="${top_dir}/tests/examples" #examples_dir="${top_dir}/tests/examples"
cp -r ${examples_dir}/c ${install_dir}/examples #cp -r ${examples_dir}/c ${install_dir}/examples
sed -i '/passwd/ {s/taosdata/prodb/g}' ${install_dir}/examples/c/*.c #sed -i '/passwd/ {s/taosdata/prodb/g}' ${install_dir}/examples/c/*.c
sed -i '/root/ {s/taosdata/prodb/g}' ${install_dir}/examples/c/*.c #sed -i '/root/ {s/taosdata/prodb/g}' ${install_dir}/examples/c/*.c
#
if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then #if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
cp -r ${examples_dir}/JDBC ${install_dir}/examples # cp -r ${examples_dir}/JDBC ${install_dir}/examples
cp -r ${examples_dir}/matlab ${install_dir}/examples # cp -r ${examples_dir}/matlab ${install_dir}/examples
mv ${install_dir}/examples/matlab/TDengineDemo.m ${install_dir}/examples/matlab/ProDBDemo.m # mv ${install_dir}/examples/matlab/TDengineDemo.m ${install_dir}/examples/matlab/ProDBDemo.m
sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/examples/matlab/ProDBDemo.m # sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/examples/matlab/ProDBDemo.m
cp -r ${examples_dir}/python ${install_dir}/examples # cp -r ${examples_dir}/python ${install_dir}/examples
sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/examples/python/read_example.py # sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/examples/python/read_example.py
cp -r ${examples_dir}/R ${install_dir}/examples # cp -r ${examples_dir}/R ${install_dir}/examples
sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/examples/R/command.txt # sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/examples/R/command.txt
cp -r ${examples_dir}/go ${install_dir}/examples # cp -r ${examples_dir}/go ${install_dir}/examples
mv ${install_dir}/examples/go/taosdemo.go ${install_dir}/examples/go/prodemo.go # mv ${install_dir}/examples/go/taosdemo.go ${install_dir}/examples/go/prodemo.go
sed -i '/root/ {s/taosdata/prodb/g}' ${install_dir}/examples/go/prodemo.go # sed -i '/root/ {s/taosdata/prodb/g}' ${install_dir}/examples/go/prodemo.go
fi #fi
# Copy driver # Copy driver
mkdir -p ${install_dir}/driver && cp ${lib_files} ${install_dir}/driver && echo "${versionComp}" > ${install_dir}/driver/vercomp.txt mkdir -p ${install_dir}/driver && cp ${lib_files} ${install_dir}/driver && echo "${versionComp}" > ${install_dir}/driver/vercomp.txt
# Copy connector # Copy connector
connector_dir="${code_dir}/connector" #connector_dir="${code_dir}/connector"
mkdir -p ${install_dir}/connector #mkdir -p ${install_dir}/connector
if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then #if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
cp ${build_dir}/lib/*.jar ${install_dir}/connector ||: # cp ${build_dir}/lib/*.jar ${install_dir}/connector ||:
if [ -d "${connector_dir}/grafanaplugin/dist" ]; then # if [ -d "${connector_dir}/grafanaplugin/dist" ]; then
cp -r ${connector_dir}/grafanaplugin/dist ${install_dir}/connector/grafanaplugin # cp -r ${connector_dir}/grafanaplugin/dist ${install_dir}/connector/grafanaplugin
else # else
echo "WARNING: grafanaplugin bundled dir not found, please check if want to use it!" # echo "WARNING: grafanaplugin bundled dir not found, please check if want to use it!"
fi # fi
if find ${connector_dir}/go -mindepth 1 -maxdepth 1 | read; then # if find ${connector_dir}/go -mindepth 1 -maxdepth 1 | read; then
cp -r ${connector_dir}/go ${install_dir}/connector # cp -r ${connector_dir}/go ${install_dir}/connector
else # else
echo "WARNING: go connector not found, please check if want to use it!" # echo "WARNING: go connector not found, please check if want to use it!"
fi # fi
cp -r ${connector_dir}/python ${install_dir}/connector/ # cp -r ${connector_dir}/python ${install_dir}/connector/
mv ${install_dir}/connector/python/taos ${install_dir}/connector/python/prodb # mv ${install_dir}/connector/python/taos ${install_dir}/connector/python/prodb
sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/connector/python/prodb/cinterface.py # sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/connector/python/prodb/cinterface.py
sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/connector/python/prodb/subscription.py # sed -i '/password/ {s/taosdata/prodb/g}' ${install_dir}/connector/python/prodb/subscription.py
sed -i '/self._password/ {s/taosdata/prodb/g}' ${install_dir}/connector/python/prodb/connection.py # sed -i '/self._password/ {s/taosdata/prodb/g}' ${install_dir}/connector/python/prodb/connection.py
fi #fi
cd ${release_dir} cd ${release_dir}
......
...@@ -27,7 +27,12 @@ ...@@ -27,7 +27,12 @@
#define MAX_IP_SIZE 20 #define MAX_IP_SIZE 20
#define MAX_HISTORY_SIZE 1000 #define MAX_HISTORY_SIZE 1000
#define MAX_COMMAND_SIZE 1048586 #define MAX_COMMAND_SIZE 1048586
#define HISTORY_FILE ".taos_history"
#ifdef _TD_PRO_
#define HISTORY_FILE ".prodb_history"
#else
#define HISTORY_FILE ".taos_history"
#endif
#define DEFAULT_RES_SHOW_NUM 100 #define DEFAULT_RES_SHOW_NUM 100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册