release.sh 3.1 KB
Newer Older
P
plum-lihui 已提交
1 2
#!/bin/bash
#
P
plum-lihui 已提交
3
# Generate the tar.gz package for linux os
P
plum-lihui 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

set -e
#set -x

# set parameters by default value
version="3.0.0.0"

curr_dir=$(pwd)

script_dir="$(dirname $(readlink -f $0))"
top_dir="$(readlink -f ${script_dir}/..)"

echo "=======================new version number: ${verNumber}======================================"

build_time=$(date +"%F %R")

P
plum-lihui 已提交
20
echo "script_dir: ${script_dir}"
P
plum-lihui 已提交
21 22 23
echo "top_dir: ${top_dir}"

cd ${top_dir}
haoranc's avatar
haoranc 已提交
24 25 26
git checkout -- .
git checkout 3.0
git pull || :
P
plum-lihui 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

echo "curr_dir: ${curr_dir}"

# 2. cmake executable file
compile_dir="${top_dir}/debug"
if [ -d ${compile_dir} ]; then
  rm -rf ${compile_dir}
fi

mkdir -p ${compile_dir}

cd ${compile_dir}

echo "compile_dir: ${compile_dir}"

haoranc's avatar
haoranc 已提交
42
cmake .. -DBUILD_TOOLS=true
P
plum-lihui 已提交
43 44 45 46 47 48 49 50 51 52 53 54
make -j32

release_dir="${top_dir}/release"
if [ -d ${release_dir} ]; then
  rm -rf ${release_dir}
fi

mkdir -p ${release_dir}
cd ${release_dir}

install_dir="${release_dir}/TDengine-server-${version}"
mkdir -p ${install_dir}
P
plum-lihui 已提交
55
mkdir -p ${install_dir}/bin
P
plum-lihui 已提交
56
mkdir -p ${install_dir}/lib
P
plum-lihui 已提交
57 58 59 60 61 62 63 64 65
mkdir -p ${install_dir}/inc

install_files="${script_dir}/install.sh"
chmod a+x ${script_dir}/install.sh || :
cp ${install_files} ${install_dir} 

header_files="${top_dir}/include/client/taos.h ${top_dir}/include/util/taoserror.h"
cp ${header_files} ${install_dir}/inc
 
haoranc's avatar
haoranc 已提交
66 67 68 69 70 71 72
bin_files="${compile_dir}/source/dnode/mgmt/taosd ${compile_dir}/tools/shell/taos  ${compile_dir}/tests/test/c/create_table ${compile_dir}/tests/test/c/tmq_sim ${script_dir}/remove.sh ${compile_dir}/build/bin/taosBenchmark   ${compile_dir}/build/bin/taosdump"
cp -rf ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :

cp -rf ${compile_dir}/source/client/libtaos.so  ${install_dir}/lib/
cp -rf ${compile_dir}/source/libs/tdb/libtdb.so ${install_dir}/lib/
cp -rf ${compile_dir}/build/lib/libavro* ${install_dir}/lib/ > /dev/null || echo -e "failed to copy avro libraries"
cp -rf ${compile_dir}/build/lib/pkgconfig  ${install_dir}/lib/ > /dev/null || echo -e "failed to copy pkgconfig directory"
P
plum-lihui 已提交
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89


#cp ${compile_dir}/source/dnode/mnode/impl/libmnode.so ${install_dir}/lib/
#cp ${compile_dir}/source/dnode/qnode/libqnode.so ${install_dir}/lib/
#cp ${compile_dir}/source/dnode/snode/libsnode.so ${install_dir}/lib/
#cp ${compile_dir}/source/dnode/bnode/libbnode.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/wal/libwal.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/scheduler/libscheduler.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/planner/libplanner.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/parser/libparser.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/qcom/libqcom.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/transport/libtransport.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/function/libfunction.so ${install_dir}/lib/
#cp ${compile_dir}/source/common/libcommon.so ${install_dir}/lib/
#cp ${compile_dir}/source/os/libos.so ${install_dir}/lib/
#cp ${compile_dir}/source/dnode/mnode/sdb/libsdb.so ${install_dir}/lib/
#cp ${compile_dir}/source/libs/catalog/libcatalog.so ${install_dir}/lib/
P
plum-lihui 已提交
90 91 92 93 94 95

pkg_name=${install_dir}-Linux-x64

tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || :