compileVersion.sh 1.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
#!/bin/bash
#
# compile test version

set -e
#set -x

# compileVersion.sh  
#                -r [ TDengine project dir]  
#                -v [ TDengine branch version ]


projectDir=/root/TDengine
TDengineBrVer="3.0"

while getopts "hr:v:" arg
do
  case $arg in
    r)
      projectDir=$(echo $OPTARG)
      ;;
    v)
      TDengineBrVer=$(echo $OPTARG)
      ;;
    h)
      echo "Usage: `basename $0` -r [ TDengine project dir] "
      echo "                  -v [ TDengine branch version] "
      exit 0
      ;;
    ?) #unknow option
      echo "unkonw argument"
      exit 1
      ;;
  esac
done

echo "projectDir=${projectDir} TDengineBrVer=${TDengineBrVer}" 

function gitPullBranchInfo () {
  branch_name=$1

  git checkout $branch_name
  echo "==== git pull $branch_name start ===="
##  git submodule update --init --recursive 
  git pull origin $branch_name ||:
  echo "==== git pull $branch_name end ===="
  git pull --recurse-submodules
}

function compileTDengineVersion() {
    debugDir=debug
    if [ -d ${debugDir} ]; then
        rm -rf ${debugDir}/*    ||:
    else
        mkdir -p ${debugDir}
    fi
    
    cd ${debugDir}
    cmake ..
    make -j24    
}
########################################################################################
###############################  main process ##########################################

## checkout all branchs and git pull
cd ${projectDir}
gitPullBranchInfo $TDengineBrVer
compileTDengineVersion

wafwerar's avatar
wafwerar 已提交
70 71 72
taos_dir=${projectDir}/debug/build/bin
taosd_dir=${projectDir}/debug/build/bin
exec_process_dir=${projectDir}/debug/build/bin
73 74 75 76

rm -f /usr/bin/taos
rm -f /usr/bin/taosd
rm -f /usr/bin/create_table
wafwerar's avatar
wafwerar 已提交
77
rm -f /usr/bin/tmq_sim
P
plum-lihui 已提交
78
rm -f /usr/bin/tmq_sim
79 80 81 82

ln -s $taos_dir/taos /usr/bin/taos
ln -s $taosd_dir/taosd /usr/bin/taosd
ln -s $exec_process_dir/create_table /usr/bin/create_table
wafwerar's avatar
wafwerar 已提交
83
ln -s $exec_process_dir/tmq_sim /usr/bin/tmq_sim
P
plum-lihui 已提交
84
ln -s $exec_process_dir/tmq_sim /usr/bin/tmq_sim
85 86