diff --git a/tools/tdgpt/script/release.sh b/tools/tdgpt/script/release.sh index c143357eb1..0114d60ecd 100755 --- a/tools/tdgpt/script/release.sh +++ b/tools/tdgpt/script/release.sh @@ -1,15 +1,33 @@ #!/bin/bash -# Generate install package for all os system + +# Generate install package for Linux Platform set -e -# set -x + +while getopts "e:v:" opt; do + case "$opt" in + e) edition="$OPTARG" ;; # -e enterprise/community + v) version="$OPTARG" ;; # -v version + *) echo "Usage: $0 -e edition -v version"; exit 1 ;; + esac +done + +if [ -z "$edition" ] || [ -z "$version" ]; then + echo "Usage: $0 -e edition -v version" + exit 1 +fi +if [ "$edition" == "enterprise" ]; then + productName="TDengine-enterprise-anode" +fi + +if [ "$edition" == "community" ]; then + productName="TDengine-community-anode" +fi + +echo start to build release package, edition: ${edition}, version: ${version} curr_dir=$(pwd) compile_dir=$1 -version="1.0.1" -osType= -pagMode= -productName="TDengine-enterprise-anode" script_dir="$(dirname $(readlink -f $0))" top_dir="$(readlink -f ${script_dir}/..)" @@ -45,18 +63,17 @@ fi # python files mkdir -p ${install_dir}/bin && mkdir -p ${install_dir}/lib +# remove cache files generated by Python interpreter +TARGET_PATTERN="__pycache__" +find "${top_dir}/taosanalytics/" -type d -name "$TARGET_PATTERN" -exec rm -rf {} + + # script to control start/stop/uninstall process -rm -r ${top_dir}/taosanalytics/*.pyc || : cp -r ${top_dir}/taosanalytics/ ${install_dir}/lib/ && chmod a+x ${install_dir}/lib/ || : cp -r ${top_dir}/script/st*.sh ${install_dir}/bin/ && chmod a+x ${install_dir}/bin/* || : cp -r ${top_dir}/script/uninstall.sh ${install_dir}/bin/ && chmod a+x ${install_dir}/bin/* || : cd ${install_dir} -#if [ "$osType" != "Darwin" ]; then -# tar -zcv -f ${tarName} ./bin/* || : -# rm -rf ${install_dir}/bin || : -#else tar -zcv -f ${tarName} ./lib/* || : if [ ! -z "${install_dir}" ]; then