diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index 1e2e69a977c0daa229c0b2d6a5681cf94e60c022..0782038c03e3cde9bd0b0563c95187a82202cbfb 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -1,6 +1,7 @@ def sync_source(branch_name) { sh ''' hostname + IP env echo ''' + branch_name + ''' ''' @@ -15,6 +16,7 @@ def sync_source(branch_name) { cd ${TDENGINE_ROOT_DIR} git reset --hard git fetch || git fetch + rm -rf examples/rust/ git checkout ''' + branch_name + ''' -f git branch git pull || git pull @@ -53,6 +55,16 @@ pipeline { defaultValue:'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{ WORK_DIR = '/var/lib/jenkins/workspace' @@ -86,26 +98,18 @@ pipeline { TD_CLIENT_EXE = "TDengine-client-${version}-Windows-x64.exe" + TD_TOOLS_TAR = "taosTools-${toolsVersion}-Linux-x64.tar.gz" + } stages { stage ('RUN') { - stage('get check package scritps'){ - agent{label 'ubuntu18'} - steps { - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - script{ - sync_source("${BRANCH_NAME}") - } - - } - } - } parallel { stage('ubuntu16') { agent{label " ubuntu16 "} steps { - timeout(time: 3, unit: 'MINUTES'){ + timeout(time: 10, unit: 'MINUTES'){ + sync_source("${BRANCH_NAME}") sh ''' cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server @@ -128,7 +132,8 @@ pipeline { stage('ubuntu18') { agent{label " ubuntu18 "} steps { - timeout(time: 3, unit: 'MINUTES'){ + timeout(time: 10, unit: 'MINUTES'){ + sync_source("${BRANCH_NAME}") sh ''' cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server @@ -151,7 +156,8 @@ pipeline { stage('centos7') { agent{label " centos7_9 "} steps { - timeout(time: 240, unit: 'MINUTES'){ + timeout(time: 10, unit: 'MINUTES'){ + sync_source("${BRANCH_NAME}") sh ''' cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server @@ -161,6 +167,7 @@ pipeline { sh ''' 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 python3 checkPackageRuning.py ''' sh ''' @@ -174,7 +181,8 @@ pipeline { stage('centos8') { agent{label " centos8_3 "} steps { - timeout(time: 240, unit: 'MINUTES'){ + timeout(time: 10, unit: 'MINUTES'){ + sync_source("${BRANCH_NAME}") sh ''' cd ${TDENGINE_ROOT_DIR}/packaging bash testpackage.sh ${TD_SERVER_TAR} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server diff --git a/packaging/checkPackageRuning.py b/packaging/checkPackageRuning.py index e53cc3bdbcc1aa0993f43ac6cdf3de53e0a4af29..c0d1e8b86c3df2150b7f434e899c545439ab0477 100755 --- a/packaging/checkPackageRuning.py +++ b/packaging/checkPackageRuning.py @@ -22,10 +22,12 @@ import time # install taospy out = subprocess.getoutput("pip3 show taospy|grep Version| awk -F ':' '{print $2}' ") -print(out) +print("taospy version %s "%out) if (out == "" ): os.system("pip install git+https://github.com/taosdata/taos-connector-python.git") print("install taos python connector") +else: + os.system("pip3 install --upgrade taospy ") diff --git a/packaging/testpackage.sh b/packaging/testpackage.sh index 173fa3a3c3a310359fafcf54806228823b9cabc6..3ca31ea7a4cca44d8ce1289ac0bbf61bc22a0ace 100755 --- a/packaging/testpackage.sh +++ b/packaging/testpackage.sh @@ -1,8 +1,32 @@ #!/bin/sh -# function installPkgAndCheckFile{ - -echo "Download package" +# # ============================= get input parameters ================================================= + +# # 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 version=$2 @@ -25,22 +49,42 @@ elif [ ${testFile} = "tools" ];then installCmd="install-taostools.sh" 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" if command -v rmtaos ;then echo "uninstall all components of TDeingne:rmtaos" - echo " " + rmtaos else echo "os doesn't include TDengine " fi if command -v rmtaostools ;then echo "uninstall all components of TDeingne:rmtaostools" - echo " " + rmtaostools else echo "os doesn't include rmtaostools " fi + +cmdInstall tree +cmdInstall wget + echo "new workroom path" installPath="/usr/local/src/packageTest" oriInstallPath="/usr/local/src/packageTest/3.1" @@ -104,6 +148,11 @@ elif [[ ${packgeName} =~ "tar" ]];then else bash ${installCmd} 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 # }