未验证 提交 68c36479 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #16483 from taosdata/test/chr/TD-14699

test: add checkpackages scritps
def sync_source(branch_name) { def sync_source(branch_name) {
sh ''' sh '''
hostname hostname
IP
env env
echo ''' + branch_name + ''' echo ''' + branch_name + '''
''' '''
...@@ -15,6 +16,7 @@ def sync_source(branch_name) { ...@@ -15,6 +16,7 @@ def sync_source(branch_name) {
cd ${TDENGINE_ROOT_DIR} cd ${TDENGINE_ROOT_DIR}
git reset --hard git reset --hard
git fetch || git fetch git fetch || git fetch
rm -rf examples/rust/
git checkout ''' + branch_name + ''' -f git checkout ''' + branch_name + ''' -f
git branch git branch
git pull || git pull git pull || git pull
...@@ -53,6 +55,16 @@ pipeline { ...@@ -53,6 +55,16 @@ pipeline {
defaultValue:'3.0.0.1', defaultValue:'3.0.0.1',
description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1' description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
) )
string (
name:'toolsVersion',
defaultValue:'2.1.2',
description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
)
string (
name:'toolsBaseVersion',
defaultValue:'2.1.2',
description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1'
)
} }
environment{ environment{
WORK_DIR = '/var/lib/jenkins/workspace' WORK_DIR = '/var/lib/jenkins/workspace'
...@@ -86,26 +98,18 @@ pipeline { ...@@ -86,26 +98,18 @@ pipeline {
TD_CLIENT_EXE = "TDengine-client-${version}-Windows-x64.exe" TD_CLIENT_EXE = "TDengine-client-${version}-Windows-x64.exe"
TD_TOOLS_TAR = "taosTools-${toolsVersion}-Linux-x64.tar.gz"
} }
stages { stages {
stage ('RUN') { stage ('RUN') {
stage('get check package scritps'){
agent{label 'ubuntu18'}
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script{
sync_source("${BRANCH_NAME}")
}
}
}
}
parallel { parallel {
stage('ubuntu16') { stage('ubuntu16') {
agent{label " ubuntu16 "} agent{label " ubuntu16 "}
steps { steps {
timeout(time: 3, unit: 'MINUTES'){ timeout(time: 10, unit: 'MINUTES'){
sync_source("${BRANCH_NAME}")
sh ''' sh '''
cd ${TDENGINE_ROOT_DIR}/packaging cd ${TDENGINE_ROOT_DIR}/packaging
bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server
...@@ -128,7 +132,8 @@ pipeline { ...@@ -128,7 +132,8 @@ pipeline {
stage('ubuntu18') { stage('ubuntu18') {
agent{label " ubuntu18 "} agent{label " ubuntu18 "}
steps { steps {
timeout(time: 3, unit: 'MINUTES'){ timeout(time: 10, unit: 'MINUTES'){
sync_source("${BRANCH_NAME}")
sh ''' sh '''
cd ${TDENGINE_ROOT_DIR}/packaging cd ${TDENGINE_ROOT_DIR}/packaging
bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server
...@@ -151,7 +156,8 @@ pipeline { ...@@ -151,7 +156,8 @@ pipeline {
stage('centos7') { stage('centos7') {
agent{label " centos7_9 "} agent{label " centos7_9 "}
steps { steps {
timeout(time: 240, unit: 'MINUTES'){ timeout(time: 10, unit: 'MINUTES'){
sync_source("${BRANCH_NAME}")
sh ''' sh '''
cd ${TDENGINE_ROOT_DIR}/packaging cd ${TDENGINE_ROOT_DIR}/packaging
bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server
...@@ -161,6 +167,7 @@ pipeline { ...@@ -161,6 +167,7 @@ pipeline {
sh ''' sh '''
cd ${TDENGINE_ROOT_DIR}/packaging cd ${TDENGINE_ROOT_DIR}/packaging
bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server
bash testpackage.sh ${TD_SERVER_LITE_TAR} ${version} ${BASE_TD_SERVER_LITE_TAR} ${baseVersion} server
python3 checkPackageRuning.py python3 checkPackageRuning.py
''' '''
sh ''' sh '''
...@@ -174,7 +181,8 @@ pipeline { ...@@ -174,7 +181,8 @@ pipeline {
stage('centos8') { stage('centos8') {
agent{label " centos8_3 "} agent{label " centos8_3 "}
steps { steps {
timeout(time: 240, unit: 'MINUTES'){ timeout(time: 10, unit: 'MINUTES'){
sync_source("${BRANCH_NAME}")
sh ''' sh '''
cd ${TDENGINE_ROOT_DIR}/packaging cd ${TDENGINE_ROOT_DIR}/packaging
bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server
......
...@@ -22,10 +22,12 @@ import time ...@@ -22,10 +22,12 @@ import time
# install taospy # install taospy
out = subprocess.getoutput("pip3 show taospy|grep Version| awk -F ':' '{print $2}' ") out = subprocess.getoutput("pip3 show taospy|grep Version| awk -F ':' '{print $2}' ")
print(out) print("taospy version %s "%out)
if (out == "" ): if (out == "" ):
os.system("pip install git+https://github.com/taosdata/taos-connector-python.git") os.system("pip install git+https://github.com/taosdata/taos-connector-python.git")
print("install taos python connector") print("install taos python connector")
else:
os.system("pip3 install --upgrade taospy ")
......
#!/bin/sh #!/bin/sh
# function installPkgAndCheckFile{ # # ============================= get input parameters =================================================
echo "Download package" # # install.sh -v [server | client] -e [yes | no] -i [systemd | service | ...]
# # set parameters by default value
# interactiveFqdn=yes # [yes | no]
# verType=server # [server | client]
# initType=systemd # [systemd | service | ...]
# while getopts "hv:d:" arg
# do
# case $arg in
# d)
# #echo "interactiveFqdn=$OPTARG"
# script_dir=$( echo $OPTARG )
# ;;
# h)
# echo "Usage: `basename $0` -d scripy_path"
# exit 0
# ;;
# ?) #unknow option
# echo "unkonw argument"
# exit 1
# ;;
# esac
# done
# echo "Download package"
packgeName=$1 packgeName=$1
version=$2 version=$2
...@@ -25,22 +49,42 @@ elif [ ${testFile} = "tools" ];then ...@@ -25,22 +49,42 @@ elif [ ${testFile} = "tools" ];then
installCmd="install-taostools.sh" installCmd="install-taostools.sh"
fi fi
function cmdInstall {
comd=$1
if command -v ${comd} ;then
echo "${comd} is already installed"
else
if command -v apt ;then
apt-get install ${comd}
elif command -v yum ;then
yum install ${comd}
else
echo "you should install ${comd} manually"
fi
fi
}
echo "Uninstall all components of TDeingne" echo "Uninstall all components of TDeingne"
if command -v rmtaos ;then if command -v rmtaos ;then
echo "uninstall all components of TDeingne:rmtaos" echo "uninstall all components of TDeingne:rmtaos"
echo " " rmtaos
else else
echo "os doesn't include TDengine " echo "os doesn't include TDengine "
fi fi
if command -v rmtaostools ;then if command -v rmtaostools ;then
echo "uninstall all components of TDeingne:rmtaostools" echo "uninstall all components of TDeingne:rmtaostools"
echo " " rmtaostools
else else
echo "os doesn't include rmtaostools " echo "os doesn't include rmtaostools "
fi fi
cmdInstall tree
cmdInstall wget
echo "new workroom path" echo "new workroom path"
installPath="/usr/local/src/packageTest" installPath="/usr/local/src/packageTest"
oriInstallPath="/usr/local/src/packageTest/3.1" oriInstallPath="/usr/local/src/packageTest/3.1"
...@@ -104,6 +148,11 @@ elif [[ ${packgeName} =~ "tar" ]];then ...@@ -104,6 +148,11 @@ elif [[ ${packgeName} =~ "tar" ]];then
else else
bash ${installCmd} bash ${installCmd}
fi fi
if [[ ${packgeName} =~ "Lite" ]];then
cd ${installPath}
wget https://www.taosdata.com/assets-download/3.0/taosTools-2.1.2-Linux-x64.tar.gz
tar xvf taosTools-2.1.2-Linux-x64.tar.gz
cd taosTools-2.1.2 && bash install-taostools.sh
fi fi
# } # }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册