TDengine/packaging/tools/makepkg.sh

452 lines
18 KiB
Bash
Raw Normal View History

2022-05-19 11:17:31 +00:00
#!/bin/bash
#
# Generate tar.gz package for all os system
set -e
# set -x
2022-05-19 11:17:31 +00:00
curr_dir=$(pwd)
compile_dir=$1
version=$2
build_time=$3
cpuType=$4
osType=$5
verMode=$6
verType=$7
pagMode=$8
versionComp=$9
dbName=${10}
productName2="${11}"
serverName2="${12}d"
clientName2="${12}"
cusEmail2="${13}"
2022-05-19 11:17:31 +00:00
script_dir="$(dirname $(readlink -f $0))"
top_dir="$(readlink -f ${script_dir}/../..)"
productName="TDengine"
serverName="taosd"
clientName="taos"
configFile="taos.cfg"
tarName="package.tar.gz"
2022-05-19 11:17:31 +00:00
dumpName="taosdump"
benchmarkName="taosBenchmark"
toolsName="taostools"
adapterName="taosadapter"
defaultPasswd="taosdata"
# create compressed install file.
build_dir="${compile_dir}/build"
code_dir="${top_dir}"
release_dir="${top_dir}/release"
#package_name='linux'
if [ "$verMode" == "cluster" ]; then
2023-11-13 12:03:06 +00:00
install_dir="${release_dir}/${productName2}-enterprise-${version}"
elif [ "$verMode" == "cloud" ]; then
install_dir="${release_dir}/${productName2}-cloud-server-${version}"
2022-05-19 11:17:31 +00:00
else
install_dir="${release_dir}/${productName2}-server-${version}"
2022-05-19 11:17:31 +00:00
fi
if [ -d ${top_dir}/tools/taos-tools/packaging/deb ]; then
cd ${top_dir}/tools/taos-tools/packaging/deb
taostools_ver=$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags|grep -v taos | tail -1)
[ -z "$taostools_ver" ] && taostools_ver="0.1.0"
taostools_install_dir="${release_dir}/${clientName2}Tools-${taostools_ver}"
2022-05-19 11:17:31 +00:00
cd ${curr_dir}
else
taostools_install_dir="${release_dir}/${clientName2}Tools-${version}"
2022-05-19 11:17:31 +00:00
fi
# Directories and files
if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/${serverName}
strip ${build_dir}/bin/${clientName}
# lite version doesn't include taosadapter, which will lead to no restful interface
2022-08-08 01:34:12 +00:00
bin_files="${build_dir}/bin/${serverName} ${build_dir}/bin/${clientName} ${script_dir}/remove.sh ${script_dir}/startPre.sh ${build_dir}/bin/taosBenchmark "
2022-05-19 11:17:31 +00:00
taostools_bin_files=""
else
if [ "$verMode" == "cloud" ]; then
2023-05-23 03:38:04 +00:00
taostools_bin_files=" ${build_dir}/bin/taosBenchmark"
else
wget https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh -O ${build_dir}/bin/TDinsight.sh \
2022-05-19 11:17:31 +00:00
&& echo "TDinsight.sh downloaded!" \
|| echo "failed to download TDinsight.sh"
# download TDinsight caches
orig_pwd=$(pwd)
tdinsight_caches=""
cd ${build_dir}/bin/ && \
chmod +x TDinsight.sh
./TDinsight.sh --download-only ||:
# tdinsight_caches=$(./TDinsight.sh --download-only | xargs -I printf "${build_dir}/bin/{} ")
cd $orig_pwd
echo "TDinsight caches: $tdinsight_caches"
taostools_bin_files=" ${build_dir}/bin/taosdump \
2022-05-19 11:17:31 +00:00
${build_dir}/bin/taosBenchmark \
${build_dir}/bin/TDinsight.sh \
${build_dir}/bin/tdengine-datasource.zip \
2023-09-11 08:51:35 +00:00
${build_dir}/bin/tdengine-datasource.zip.md5"
fi
2022-05-19 11:17:31 +00:00
bin_files="${build_dir}/bin/${serverName} \
${build_dir}/bin/${clientName} \
${taostools_bin_files} \
${build_dir}/bin/${clientName}adapter \
2024-11-29 07:23:14 +00:00
${build_dir}/bin/${clientName}keeper \
2025-03-06 14:20:52 +00:00
${build_dir}/bin/taosudf \
2022-05-19 11:17:31 +00:00
${script_dir}/remove.sh \
${script_dir}/set_core.sh \
${script_dir}/startPre.sh \
2024-04-29 07:40:02 +00:00
${script_dir}/quick_deploy.sh \
2022-05-19 11:17:31 +00:00
${script_dir}/taosd-dump-cfg.gdb"
fi
if [ "$osType" == "Darwin" ]; then
lib_files="${build_dir}/lib/libtaos.${version}.dylib"
new-libtaos-with-ws (#29971) * enh: rename libtaos.so to libtaosinternal.so * enh: let python system-test work * enh: shell for libinternal.so * enh: refact script * enh: wrapper for libtaosinternal * enh: rename some files * enh: let shell support internal driver * enh: minor changes * enh: minor changes * add intenal.h * enh: remove unused codes * enh: minor changs * feat: mac os issues * enh: let python test use internal connection * enh: let nettest work * enh: let taosc -C work * enh: test shell in mac os * enh: minor changes * enh: let libtaosinternal.so work in linux * enh: update install script * enh: for ci * enh: for windows compile * enh: minor changes * enh: compile in windows * enh: minor changes * enh: taosinternal work in windows * enh: add taos_internal_static * enh: rollback os_for_wrapper * fix: conflicts * fix: conflicts * fix: compile errors * fix: conflicts * enh: rename taosinternal to taosnative * enh: rename taosinternal to taosnative * fix: compile error * enh: remove taosnative.h * fix: compile errors * enh: set default shell options * fix: compile errors * fix: compile errors * debug: switch taosws branch to feat/new-libtaos-with-ws * enh: taosBenchmark remove WEBSOCKET finished * fix: CMakeLists.txt remove WEBSOCKET * fix: compile errors * fix: taosBenchmark delete restful code * .gitignore remove taos-tools folder * fix: remove taosdump WEBSOCKET MACRO * fix: build error for taosdump * fix: build project passed * fix: support -Z for connect mode * fix: build error * fix: build error fixed * fix: add -Z options * fix: native and websocket with string * fix: -Z option core * fix: build unit test * fix: build error * fix: add colon for array * fix: unit test can not include fun * fix: CTest pointer null is nullptr * fix: include pub.h * fix: taosdump add -Z --driver options * fix: taosdump support -Z with pub.h pub.c * fix: toolsGetTimeDay move to pub.c * fix: restore pub.c only simple fun * fix: add error tips * fix: tmfree remove from taosdump * fix: remove double declare taos variant * fix: taos support -Z option * enh: configDir set with main fun * fix: add g_arguments.configDir * fix: show tips add cfgdir * fix: g_argument is pointer * fix: configDir is global var * fix: declare g_configDir in benchMain.c * fix: taos version not show on websocket * stmt2 websocket prepare with supertable * stmt2 websocket prepare build * fix: stmt and stmt2 prepare add db name * fix: remove -R --restful test case * fix: taosBenchmark adjust priority cmd > json > evn * fix: add connect mode test case connMode.py * fix: clear evn and add host port check * fix: army/test.py modify start taosAdapter is default * change: system-test/test.py default start taosAdapter * fix: add taosAdapter variant to system-test/test.py * fix: -y must put behind other options * fix: remove rest sml and add -N normal case * fix: add -c work cfg test case * del: queryMain.py remove rest query * fix: remove groups have a blank append bug * fix: caseBase.py add db in sql query * fix: query_json.py remove rest test * fix: taosBenchmark uniform dsn describe * fix: add pub.h pub.c to tools public * fix: case remove restful interface * fix: build error * fix: taosDriverCleanup no arg call * fix: taosdump add test conn mode case taosdumpCommandline.py * fix: modify insertFullType.json db name * fix: taosdump connMode test case taosDumpCommandline.py passed * enh: priority cmd > env > json * fix: taosCli remove is_native variant * fix: password is not pointer * fix: comment -o test case * fix: solve fun return code check * fix: windows unresolved strcasecmp * fix: remove coverHostToServAddr * fix: forbid check ODR violation * ci: trigger pr run * fix: build error not del >>>>>3.0 * fix: support json dbinfo->vgroups have blank space * fix: solve conflict with merge * fix: with TrimCaseCmp fun to compare vgroups * fix: del vgroups support blank code * feat: wrapper add taos_fetch_fields_e * fix: move jni from libtaosnative.so to libtaos.so * fix: move clientTmqConnector.c for jni * fix: fix assert check with del comment code * fix: taosBenchmark add prepare stmt debug log * fix: stmt2 already have debug log on preapare * fix: (double)LLONG_MAX force covert * fix: stmt insert normal table with websocket * fix: normal table with stmt too many ? * fix: taosdump stmt_prepare with child tbname * fix: build error add int code * feat: stmtPrepare with child table to do * taos -a options move to native test case * fix:unit test benchmarkTest passed * fix: query_json-with-sqlfile.py case no check results * fix: queryMain.py case lost, put in tasks again --------- Co-authored-by: Shengliang Guan <slguan@taosdata.com>
2025-03-20 14:54:29 +00:00
nativelib_files="${build_dir}/lib/libtaosnative.${version}.dylib"
wslib_files="${build_dir}/lib/libtaosws.dylib"
else
lib_files="${build_dir}/lib/libtaos.so.${version}"
new-libtaos-with-ws (#29971) * enh: rename libtaos.so to libtaosinternal.so * enh: let python system-test work * enh: shell for libinternal.so * enh: refact script * enh: wrapper for libtaosinternal * enh: rename some files * enh: let shell support internal driver * enh: minor changes * enh: minor changes * add intenal.h * enh: remove unused codes * enh: minor changs * feat: mac os issues * enh: let python test use internal connection * enh: let nettest work * enh: let taosc -C work * enh: test shell in mac os * enh: minor changes * enh: let libtaosinternal.so work in linux * enh: update install script * enh: for ci * enh: for windows compile * enh: minor changes * enh: compile in windows * enh: minor changes * enh: taosinternal work in windows * enh: add taos_internal_static * enh: rollback os_for_wrapper * fix: conflicts * fix: conflicts * fix: compile errors * fix: conflicts * enh: rename taosinternal to taosnative * enh: rename taosinternal to taosnative * fix: compile error * enh: remove taosnative.h * fix: compile errors * enh: set default shell options * fix: compile errors * fix: compile errors * debug: switch taosws branch to feat/new-libtaos-with-ws * enh: taosBenchmark remove WEBSOCKET finished * fix: CMakeLists.txt remove WEBSOCKET * fix: compile errors * fix: taosBenchmark delete restful code * .gitignore remove taos-tools folder * fix: remove taosdump WEBSOCKET MACRO * fix: build error for taosdump * fix: build project passed * fix: support -Z for connect mode * fix: build error * fix: build error fixed * fix: add -Z options * fix: native and websocket with string * fix: -Z option core * fix: build unit test * fix: build error * fix: add colon for array * fix: unit test can not include fun * fix: CTest pointer null is nullptr * fix: include pub.h * fix: taosdump add -Z --driver options * fix: taosdump support -Z with pub.h pub.c * fix: toolsGetTimeDay move to pub.c * fix: restore pub.c only simple fun * fix: add error tips * fix: tmfree remove from taosdump * fix: remove double declare taos variant * fix: taos support -Z option * enh: configDir set with main fun * fix: add g_arguments.configDir * fix: show tips add cfgdir * fix: g_argument is pointer * fix: configDir is global var * fix: declare g_configDir in benchMain.c * fix: taos version not show on websocket * stmt2 websocket prepare with supertable * stmt2 websocket prepare build * fix: stmt and stmt2 prepare add db name * fix: remove -R --restful test case * fix: taosBenchmark adjust priority cmd > json > evn * fix: add connect mode test case connMode.py * fix: clear evn and add host port check * fix: army/test.py modify start taosAdapter is default * change: system-test/test.py default start taosAdapter * fix: add taosAdapter variant to system-test/test.py * fix: -y must put behind other options * fix: remove rest sml and add -N normal case * fix: add -c work cfg test case * del: queryMain.py remove rest query * fix: remove groups have a blank append bug * fix: caseBase.py add db in sql query * fix: query_json.py remove rest test * fix: taosBenchmark uniform dsn describe * fix: add pub.h pub.c to tools public * fix: case remove restful interface * fix: build error * fix: taosDriverCleanup no arg call * fix: taosdump add test conn mode case taosdumpCommandline.py * fix: modify insertFullType.json db name * fix: taosdump connMode test case taosDumpCommandline.py passed * enh: priority cmd > env > json * fix: taosCli remove is_native variant * fix: password is not pointer * fix: comment -o test case * fix: solve fun return code check * fix: windows unresolved strcasecmp * fix: remove coverHostToServAddr * fix: forbid check ODR violation * ci: trigger pr run * fix: build error not del >>>>>3.0 * fix: support json dbinfo->vgroups have blank space * fix: solve conflict with merge * fix: with TrimCaseCmp fun to compare vgroups * fix: del vgroups support blank code * feat: wrapper add taos_fetch_fields_e * fix: move jni from libtaosnative.so to libtaos.so * fix: move clientTmqConnector.c for jni * fix: fix assert check with del comment code * fix: taosBenchmark add prepare stmt debug log * fix: stmt2 already have debug log on preapare * fix: (double)LLONG_MAX force covert * fix: stmt insert normal table with websocket * fix: normal table with stmt too many ? * fix: taosdump stmt_prepare with child tbname * fix: build error add int code * feat: stmtPrepare with child table to do * taos -a options move to native test case * fix:unit test benchmarkTest passed * fix: query_json-with-sqlfile.py case no check results * fix: queryMain.py case lost, put in tasks again --------- Co-authored-by: Shengliang Guan <slguan@taosdata.com>
2025-03-20 14:54:29 +00:00
nativelib_files="${build_dir}/lib/libtaosnative.so.${version}"
wslib_files="${build_dir}/lib/libtaosws.so"
fi
header_files="${code_dir}/include/client/taos.h ${code_dir}/include/common/taosdef.h ${code_dir}/include/util/taoserror.h ${code_dir}/include/util/tdef.h ${code_dir}/include/libs/function/taosudf.h"
2022-05-19 11:17:31 +00:00
wsheader_files="${build_dir}/include/taosws.h"
2022-05-19 11:17:31 +00:00
if [ "$dbName" != "taos" ]; then
cfg_dir="${top_dir}/../enterprise/packaging/cfg"
else
cfg_dir="${top_dir}/packaging/cfg"
fi
install_files="${script_dir}/install.sh"
init_file_deb=${script_dir}/../deb/taosd
init_file_rpm=${script_dir}/../rpm/taosd
# make directories.
mkdir -p ${install_dir}
mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
[ -f ${wsheader_files} ] && cp ${wsheader_files} ${install_dir}/inc || :
2022-05-19 11:17:31 +00:00
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/${configFile} ${install_dir}/cfg/${configFile}
if [ -f "${compile_dir}/test/cfg/${clientName}adapter.toml" ]; then
cp ${compile_dir}/test/cfg/${clientName}adapter.toml ${install_dir}/cfg || :
2022-05-19 11:17:31 +00:00
fi
2024-11-29 07:23:14 +00:00
if [ -f "${compile_dir}/test/cfg/${clientName}keeper.toml" ]; then
cp ${compile_dir}/test/cfg/${clientName}keeper.toml ${install_dir}/cfg || :
fi
2022-05-19 11:17:31 +00:00
if [ -f "${compile_dir}/test/cfg/${clientName}adapter.service" ]; then
cp ${compile_dir}/test/cfg/${clientName}adapter.service ${install_dir}/cfg || :
2022-05-19 11:17:31 +00:00
fi
2024-11-29 07:23:14 +00:00
if [ -f "${compile_dir}/test/cfg/${clientName}keeper.service" ]; then
cp ${compile_dir}/test/cfg/${clientName}keeper.service ${install_dir}/cfg || :
fi
2022-05-19 11:17:31 +00:00
if [ -f "${cfg_dir}/${serverName}.service" ]; then
cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || :
fi
mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${serverName}.deb
mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm
2023-04-14 10:01:56 +00:00
# mkdir -p ${install_dir}/share && cp -rf ${build_dir}/share/{etc,srv} ${install_dir}/share ||:
2022-05-19 11:17:31 +00:00
if [ $adapterName != "taosadapter" ]; then
mv ${install_dir}/cfg/${clientName2}adapter.toml ${install_dir}/cfg/$adapterName.toml
2022-05-19 11:17:31 +00:00
sed -i "s/path = \"\/var\/log\/taos\"/path = \"\/var\/log\/${productName}\"/g" ${install_dir}/cfg/$adapterName.toml
sed -i "s/password = \"taosdata\"/password = \"${defaultPasswd}\"/g" ${install_dir}/cfg/$adapterName.toml
mv ${install_dir}/cfg/${clientName2}adapter.service ${install_dir}/cfg/$adapterName.service
2022-05-19 11:17:31 +00:00
sed -i "s/TDengine/${productName}/g" ${install_dir}/cfg/$adapterName.service
sed -i "s/taosAdapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service
sed -i "s/taosadapter/${adapterName}/g" ${install_dir}/cfg/$adapterName.service
mv ${install_dir}/bin/${clientName2}adapter ${install_dir}/bin/${adapterName}
2022-05-19 11:17:31 +00:00
mv ${install_dir}/bin/taosd-dump-cfg.gdb ${install_dir}/bin/${serverName}-dump-cfg.gdb
fi
# if [ -n "${taostools_bin_files}" ]; then
# mkdir -p ${taostools_install_dir} || echo -e "failed to create ${taostools_install_dir}"
# mkdir -p ${taostools_install_dir}/bin \
# && cp ${taostools_bin_files} ${taostools_install_dir}/bin \
# && chmod a+x ${taostools_install_dir}/bin/* || :
# if [ -f ${top_dir}/tools/taos-tools/packaging/tools/install-tools.sh ]; then
# cp ${top_dir}/tools/taos-tools/packaging/tools/install-tools.sh \
# ${taostools_install_dir}/ > /dev/null \
# && chmod a+x ${taostools_install_dir}/install-tools.sh \
# || echo -e "failed to copy install-tools.sh"
# else
# echo -e "install-tools.sh not found"
# fi
# if [ -f ${top_dir}/tools/taos-tools/packaging/tools/uninstall-tools.sh ]; then
# cp ${top_dir}/tools/taos-tools/packaging/tools/uninstall-tools.sh \
# ${taostools_install_dir}/ > /dev/null \
# && chmod a+x ${taostools_install_dir}/uninstall-tools.sh \
# || echo -e "failed to copy uninstall-tools.sh"
# else
# echo -e "uninstall-tools.sh not found"
# fi
# if [ -f ${build_dir}/lib/libavro.so.23.0.0 ]; then
# mkdir -p ${taostools_install_dir}/avro/{lib,lib/pkgconfig} || echo -e "failed to create ${taostools_install_dir}/avro"
# cp ${build_dir}/lib/libavro.* ${taostools_install_dir}/avro/lib
# cp ${build_dir}/lib/pkgconfig/avro-c.pc ${taostools_install_dir}/avro/lib/pkgconfig
# fi
# fi
2022-05-19 11:17:31 +00:00
if [ -f ${build_dir}/bin/jemalloc-config ]; then
mkdir -p ${install_dir}/jemalloc/{bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3}
cp ${build_dir}/bin/jemalloc-config ${install_dir}/jemalloc/bin
if [ -f ${build_dir}/bin/jemalloc.sh ]; then
cp ${build_dir}/bin/jemalloc.sh ${install_dir}/jemalloc/bin
fi
if [ -f ${build_dir}/bin/jeprof ]; then
cp ${build_dir}/bin/jeprof ${install_dir}/jemalloc/bin
fi
if [ -f ${build_dir}/include/jemalloc/jemalloc.h ]; then
cp ${build_dir}/include/jemalloc/jemalloc.h ${install_dir}/jemalloc/include/jemalloc
fi
if [ -f ${build_dir}/lib/libjemalloc.so.2 ]; then
cp ${build_dir}/lib/libjemalloc.so.2 ${install_dir}/jemalloc/lib
ln -sf libjemalloc.so.2 ${install_dir}/jemalloc/lib/libjemalloc.so
fi
# if [ -f ${build_dir}/lib/libjemalloc.a ]; then
# cp ${build_dir}/lib/libjemalloc.a ${install_dir}/jemalloc/lib
# fi
# if [ -f ${build_dir}/lib/libjemalloc_pic.a ]; then
# cp ${build_dir}/lib/libjemalloc_pic.a ${install_dir}/jemalloc/lib
# fi
2022-05-19 11:17:31 +00:00
if [ -f ${build_dir}/lib/pkgconfig/jemalloc.pc ]; then
cp ${build_dir}/lib/pkgconfig/jemalloc.pc ${install_dir}/jemalloc/lib/pkgconfig
fi
if [ -f ${build_dir}/share/doc/jemalloc/jemalloc.html ]; then
cp ${build_dir}/share/doc/jemalloc/jemalloc.html ${install_dir}/jemalloc/share/doc/jemalloc
fi
if [ -f ${build_dir}/share/man/man3/jemalloc.3 ]; then
cp ${build_dir}/share/man/man3/jemalloc.3 ${install_dir}/jemalloc/share/man/man3
fi
fi
if [ "$verMode" == "cluster" ]; then
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${clientName2}\"/g" remove_temp.sh
2024-04-26 01:41:13 +00:00
sed -i "s/productName=\"TDengine\"/productName=\"${productName2}\"/g" remove_temp.sh
2022-05-19 11:17:31 +00:00
mv remove_temp.sh ${install_dir}/bin/remove.sh
fi
if [ "$verMode" == "cloud" ]; then
sed 's/verMode=edge/verMode=cloud/g' ${install_dir}/bin/remove.sh >>remove_temp.sh
mv remove_temp.sh ${install_dir}/bin/remove.sh
2022-05-19 11:17:31 +00:00
fi
cd ${install_dir}
if [ "$osType" != "Darwin" ]; then
tar -zcv -f ${tarName} * --remove-files || :
ls ${install_dir}
else
tar -zcv -f ${tarName} * || :
fi
2022-05-19 11:17:31 +00:00
exitcode=$?
if [ "$exitcode" != "0" ]; then
echo "tar ${tarName} error !!!"
exit $exitcode
fi
cd ${curr_dir}
cp ${install_files} ${install_dir}
cp ${install_dir}/install.sh install_temp.sh
2022-05-19 11:17:31 +00:00
if [ "$verMode" == "cluster" ]; then
sed -i 's/verMode=edge/verMode=cluster/g' install_temp.sh
2024-04-29 07:40:02 +00:00
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${clientName2}\"/g" install_temp.sh
2024-04-26 01:41:13 +00:00
sed -i "s/productName=\"TDengine\"/productName=\"${productName2}\"/g" install_temp.sh
cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
2024-04-26 01:41:13 +00:00
sed -i "s/emailName=\"taosdata.com\"/emailName=\"${cusDomain}\"/g" install_temp.sh
2022-05-19 11:17:31 +00:00
mv install_temp.sh ${install_dir}/install.sh
fi
if [ "$verMode" == "cloud" ]; then
sed -i 's/verMode=edge/verMode=cloud/g' install_temp.sh
mv install_temp.sh ${install_dir}/install.sh
fi
2022-05-19 11:17:31 +00:00
if [ "$pagMode" == "lite" ]; then
sed -i 's/pagMode=full/pagMode=lite/g' install_temp.sh
2022-05-19 11:17:31 +00:00
mv install_temp.sh ${install_dir}/install.sh
fi
chmod a+x ${install_dir}/install.sh
2023-11-13 12:03:06 +00:00
if [[ $dbName == "taos" ]]; then
2023-10-15 08:34:58 +00:00
cp ${top_dir}/../enterprise/packaging/start-all.sh ${install_dir}
cp ${top_dir}/../enterprise/packaging/stop-all.sh ${install_dir}
cp ${top_dir}/../enterprise/packaging/README.md ${install_dir}
chmod a+x ${install_dir}/start-all.sh
chmod a+x ${install_dir}/stop-all.sh
2023-11-13 12:03:06 +00:00
# Copy example code
2022-05-19 11:17:31 +00:00
mkdir -p ${install_dir}/examples
examples_dir="${top_dir}/examples"
2024-08-26 08:49:59 +00:00
new_example_dir="${top_dir}/docs/examples"
2022-05-19 11:17:31 +00:00
cp -r ${examples_dir}/c ${install_dir}/examples
if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
2024-08-26 08:49:59 +00:00
if [ -d ${new_example_dir}/JDBC/connectionPools/target ]; then
rm -rf ${new_example_dir}/JDBC/connectionPools/target
2022-05-19 11:17:31 +00:00
fi
2024-08-26 08:49:59 +00:00
if [ -d ${new_example_dir}/JDBC/JDBCDemo/target ]; then
rm -rf ${new_example_dir}/JDBC/JDBCDemo/target
2022-05-19 11:17:31 +00:00
fi
2024-08-26 08:49:59 +00:00
if [ -d ${new_example_dir}/JDBC/mybatisplus-demo/target ]; then
rm -rf ${new_example_dir}/JDBC/mybatisplus-demo/target
2022-05-19 11:17:31 +00:00
fi
2024-08-26 08:49:59 +00:00
if [ -d ${new_example_dir}/JDBC/springbootdemo/target ]; then
rm -rf ${new_example_dir}/JDBC/springbootdemo/target
2022-05-19 11:17:31 +00:00
fi
2024-08-26 08:49:59 +00:00
if [ -d ${new_example_dir}/JDBC/SpringJdbcTemplate/target ]; then
rm -rf ${new_example_dir}/JDBC/SpringJdbcTemplate/target
2022-05-19 11:17:31 +00:00
fi
2024-08-26 08:49:59 +00:00
if [ -d ${new_example_dir}/JDBC/taosdemo/target ]; then
rm -rf ${new_example_dir}/JDBC/taosdemo/target
2022-05-19 11:17:31 +00:00
fi
2024-08-26 08:49:59 +00:00
cp -r ${new_example_dir}/JDBC ${install_dir}/examples ||:
cp -r ${examples_dir}/matlab ${install_dir}/examples ||:
cp -r ${examples_dir}/python ${install_dir}/examples ||:
cp -r ${examples_dir}/R ${install_dir}/examples ||:
cp -r ${examples_dir}/go ${install_dir}/examples ||:
cp -r ${examples_dir}/nodejs ${install_dir}/examples ||:
cp -r ${examples_dir}/C# ${install_dir}/examples ||:
2022-05-19 11:17:31 +00:00
mkdir -p ${install_dir}/examples/taosbenchmark-json && cp ${examples_dir}/../tools/taos-tools/example/* ${install_dir}/examples/taosbenchmark-json
fi
2023-08-07 03:18:47 +00:00
if [ "$verMode" == "cluster" ] || [ "$verMode" == "cloud" ]; then
mkdir -p ${install_dir}/share/
cp -rf ${build_dir}/share/{etc,srv} ${install_dir}/share ||:
fi
2022-05-19 11:17:31 +00:00
fi
# Copy driver
new-libtaos-with-ws (#29971) * enh: rename libtaos.so to libtaosinternal.so * enh: let python system-test work * enh: shell for libinternal.so * enh: refact script * enh: wrapper for libtaosinternal * enh: rename some files * enh: let shell support internal driver * enh: minor changes * enh: minor changes * add intenal.h * enh: remove unused codes * enh: minor changs * feat: mac os issues * enh: let python test use internal connection * enh: let nettest work * enh: let taosc -C work * enh: test shell in mac os * enh: minor changes * enh: let libtaosinternal.so work in linux * enh: update install script * enh: for ci * enh: for windows compile * enh: minor changes * enh: compile in windows * enh: minor changes * enh: taosinternal work in windows * enh: add taos_internal_static * enh: rollback os_for_wrapper * fix: conflicts * fix: conflicts * fix: compile errors * fix: conflicts * enh: rename taosinternal to taosnative * enh: rename taosinternal to taosnative * fix: compile error * enh: remove taosnative.h * fix: compile errors * enh: set default shell options * fix: compile errors * fix: compile errors * debug: switch taosws branch to feat/new-libtaos-with-ws * enh: taosBenchmark remove WEBSOCKET finished * fix: CMakeLists.txt remove WEBSOCKET * fix: compile errors * fix: taosBenchmark delete restful code * .gitignore remove taos-tools folder * fix: remove taosdump WEBSOCKET MACRO * fix: build error for taosdump * fix: build project passed * fix: support -Z for connect mode * fix: build error * fix: build error fixed * fix: add -Z options * fix: native and websocket with string * fix: -Z option core * fix: build unit test * fix: build error * fix: add colon for array * fix: unit test can not include fun * fix: CTest pointer null is nullptr * fix: include pub.h * fix: taosdump add -Z --driver options * fix: taosdump support -Z with pub.h pub.c * fix: toolsGetTimeDay move to pub.c * fix: restore pub.c only simple fun * fix: add error tips * fix: tmfree remove from taosdump * fix: remove double declare taos variant * fix: taos support -Z option * enh: configDir set with main fun * fix: add g_arguments.configDir * fix: show tips add cfgdir * fix: g_argument is pointer * fix: configDir is global var * fix: declare g_configDir in benchMain.c * fix: taos version not show on websocket * stmt2 websocket prepare with supertable * stmt2 websocket prepare build * fix: stmt and stmt2 prepare add db name * fix: remove -R --restful test case * fix: taosBenchmark adjust priority cmd > json > evn * fix: add connect mode test case connMode.py * fix: clear evn and add host port check * fix: army/test.py modify start taosAdapter is default * change: system-test/test.py default start taosAdapter * fix: add taosAdapter variant to system-test/test.py * fix: -y must put behind other options * fix: remove rest sml and add -N normal case * fix: add -c work cfg test case * del: queryMain.py remove rest query * fix: remove groups have a blank append bug * fix: caseBase.py add db in sql query * fix: query_json.py remove rest test * fix: taosBenchmark uniform dsn describe * fix: add pub.h pub.c to tools public * fix: case remove restful interface * fix: build error * fix: taosDriverCleanup no arg call * fix: taosdump add test conn mode case taosdumpCommandline.py * fix: modify insertFullType.json db name * fix: taosdump connMode test case taosDumpCommandline.py passed * enh: priority cmd > env > json * fix: taosCli remove is_native variant * fix: password is not pointer * fix: comment -o test case * fix: solve fun return code check * fix: windows unresolved strcasecmp * fix: remove coverHostToServAddr * fix: forbid check ODR violation * ci: trigger pr run * fix: build error not del >>>>>3.0 * fix: support json dbinfo->vgroups have blank space * fix: solve conflict with merge * fix: with TrimCaseCmp fun to compare vgroups * fix: del vgroups support blank code * feat: wrapper add taos_fetch_fields_e * fix: move jni from libtaosnative.so to libtaos.so * fix: move clientTmqConnector.c for jni * fix: fix assert check with del comment code * fix: taosBenchmark add prepare stmt debug log * fix: stmt2 already have debug log on preapare * fix: (double)LLONG_MAX force covert * fix: stmt insert normal table with websocket * fix: normal table with stmt too many ? * fix: taosdump stmt_prepare with child tbname * fix: build error add int code * feat: stmtPrepare with child table to do * taos -a options move to native test case * fix:unit test benchmarkTest passed * fix: query_json-with-sqlfile.py case no check results * fix: queryMain.py case lost, put in tasks again --------- Co-authored-by: Shengliang Guan <slguan@taosdata.com>
2025-03-20 14:54:29 +00:00
mkdir -p ${install_dir}/driver && cp ${lib_files} ${install_dir}/driver && cp ${nativelib_files} ${install_dir}/driver && echo "${versionComp}" >${install_dir}/driver/vercomp.txt
[ -f ${wslib_files} ] && cp ${wslib_files} ${install_dir}/driver || :
2022-05-19 11:17:31 +00:00
2023-11-13 12:03:06 +00:00
# Copy connector && taosx
if [ "$verMode" == "cluster" ]; then
2022-05-19 11:17:31 +00:00
connector_dir="${code_dir}/connector"
mkdir -p ${install_dir}/connector
if [[ "$pagMode" != "lite" ]] && [[ "$cpuType" != "aarch32" ]]; then
tmp_pwd=`pwd`
cd ${install_dir}/connector
if [ ! -d taos-connector-jdbc ];then
2023-09-05 10:05:15 +00:00
git clone -b main --depth=1 https://github.com/taosdata/taos-connector-jdbc.git ||:
fi
cd taos-connector-jdbc
mvn clean package -Dmaven.test.skip=true
echo ${build_dir}/lib/
cp target/*.jar ${build_dir}/lib/
cd ${install_dir}/connector
rm -rf taos-connector-jdbc
cd ${tmp_pwd}
jars=$(ls ${build_dir}/lib/*.jar 2>/dev/null|wc -l)
[ "${jars}" != "0" ] && cp ${build_dir}/lib/*.jar ${install_dir}/connector || :
git clone --depth 1 https://github.com/taosdata/driver-go ${install_dir}/connector/go
rm -rf ${install_dir}/connector/go/.git ||:
2022-05-19 11:17:31 +00:00
git clone --depth 1 https://github.com/taosdata/taos-connector-python ${install_dir}/connector/python
rm -rf ${install_dir}/connector/python/.git ||:
git clone --depth 1 https://github.com/taosdata/taos-connector-node ${install_dir}/connector/nodejs
rm -rf ${install_dir}/connector/nodejs/.git ||:
git clone --depth 1 https://github.com/taosdata/taos-connector-dotnet ${install_dir}/connector/dotnet
rm -rf ${install_dir}/connector/dotnet/.git ||:
git clone --depth 1 https://github.com/taosdata/taos-connector-rust ${install_dir}/connector/rust
2022-05-19 11:17:31 +00:00
rm -rf ${install_dir}/connector/rust/.git ||:
2023-11-13 12:03:06 +00:00
# copy taosx
if [ -d ${top_dir}/../enterprise/src/plugins/taosx/release/${clientName2}x ]; then
cp -r ${top_dir}/../enterprise/src/plugins/taosx/release/${clientName2}x ${install_dir}
cp ${top_dir}/../enterprise/src/plugins/taosx/packaging/uninstall.sh ${install_dir}/${clientName2}x/uninstall_${clientName2}x.sh
sed -i "s/uninstall.sh/uninstall_${clientName2}x.sh/g" ${install_dir}/${clientName2}x/uninstall_${clientName2}x.sh
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${clientName2}\"/g" ${install_dir}/${clientName2}x/uninstall_${clientName2}x.sh
2023-11-13 12:03:06 +00:00
fi
2022-05-19 11:17:31 +00:00
fi
fi
# Copy release note
2022-08-12 16:03:42 +00:00
# cp ${script_dir}/release_note ${install_dir}
2022-05-19 11:17:31 +00:00
# exit 1
cd ${release_dir}
# install_dir has been distinguishes cluster from edege, so comments this code
pkg_name=${install_dir}-${osType}-${cpuType}
versionCompFirst=$(echo ${versionComp} | awk -F '.' '{print $1}')
taostools_pkg_name=${taostools_install_dir}-${osType}-${cpuType}-comp${versionCompFirst}
2022-05-19 11:17:31 +00:00
# if [ "$verMode" == "cluster" ]; then
# pkg_name=${install_dir}-${osType}-${cpuType}
# elif [ "$verMode" == "edge" ]; then
# pkg_name=${install_dir}-${osType}-${cpuType}
# else
# echo "unknow verMode, nor cluster or edge"
# exit 1
# fi
if [[ "$verType" == "beta" ]] || [[ "$verType" == "preRelease" ]]; then
pkg_name=${install_dir}-${verType}-${osType}-${cpuType}
taostools_pkg_name=${taostools_install_dir}-${verType}-${osType}-${cpuType}
elif [ "$verType" == "stable" ]; then
pkg_name=${pkg_name}
taostools_pkg_name=${taostools_pkg_name}
else
echo "unknow verType, nor stabel or beta"
exit 1
fi
if [ "$pagMode" == "lite" ]; then
pkg_name=${pkg_name}-Lite
fi
if [ "$osType" != "Darwin" ]; then
tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" --remove-files || :
else
tar -zcv -f "$(basename ${pkg_name}).tar.gz" "$(basename ${install_dir})" || :
rm -rf ${install_dir} ||:
([ -d build-taoskeeper ] && rm -rf build-taoskeeper ) ||:
fi
2022-05-19 11:17:31 +00:00
exitcode=$?
if [ "$exitcode" != "0" ]; then
echo "tar ${pkg_name}.tar.gz error !!!"
exit $exitcode
fi
2024-11-29 07:23:14 +00:00
# if [ -n "${taostools_bin_files}" ] && [ "$verMode" != "cloud" ]; then
# wget https://github.com/taosdata/grafanaplugin/releases/latest/download/TDinsight.sh -O ${taostools_install_dir}/bin/TDinsight.sh && echo "TDinsight.sh downloaded!"|| echo "failed to download TDinsight.sh"
# if [ "$osType" != "Darwin" ]; then
# tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" --remove-files || :
# else
# tar -zcv -f "$(basename ${taostools_pkg_name}).tar.gz" "$(basename ${taostools_install_dir})" || :
# rm -rf ${taostools_install_dir} ||:
# fi
# exitcode=$?
# if [ "$exitcode" != "0" ]; then
# echo "tar ${taostools_pkg_name}.tar.gz error !!!"
# exit $exitcode
# fi
# fi
2022-05-19 11:17:31 +00:00
cd ${curr_dir}