diff --git a/packaging/MPtestJenkinsfile b/packaging/MPtestJenkinsfile index 5b793459164baec2791107842bddb3f0bb90b2df..5dc8024f29ddc0f09727d167aceb3f2516886488 100644 --- a/packaging/MPtestJenkinsfile +++ b/packaging/MPtestJenkinsfile @@ -13,7 +13,7 @@ def sync_source(branch_name) { git branch git pull || git pull git log | head -n 20 - git submodule update --init --recursive + git clean -fxd ''' return 1 } @@ -37,19 +37,24 @@ def build_run() { pipeline { agent none parameters { + choice( + name: 'sourcePath', + choices: ['nas','web'], + description: 'choice which way to download the installation pacakge;web is Office Web and nas means taos nas server ' + ) string ( name:'version', - defaultValue:'3.0.0.1', + defaultValue:'3.0.1.6', description: 'release version number,eg: 3.0.0.1 or 3.0.0.' ) string ( name:'baseVersion', - defaultValue:'3.0.0.1', + defaultValue:'3.0.1.6', description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1' ) string ( name:'toolsVersion', - defaultValue:'2.1.2', + defaultValue:'2.2.7', description: 'This number of baseVerison is generally not modified.Now it is 3.0.0.1' ) string ( @@ -62,7 +67,7 @@ pipeline { WORK_DIR = '/var/lib/jenkins/workspace' TDINTERNAL_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal' TDENGINE_ROOT_DIR = '/var/lib/jenkins/workspace/TDinternal/community' - BRANCH_NAME = 'test/chr/TD-14699' + BRANCH_NAME = '3.0' TD_SERVER_TAR = "TDengine-server-${version}-Linux-x64.tar.gz" BASE_TD_SERVER_TAR = "TDengine-server-${baseVersion}-Linux-x64.tar.gz" @@ -104,17 +109,17 @@ pipeline { sync_source("${BRANCH_NAME}") sh ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server + bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} python3 checkPackageRuning.py ''' } @@ -127,17 +132,17 @@ pipeline { sync_source("${BRANCH_NAME}") sh ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server + bash testpackage.sh ${TD_SERVER_DEB} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} python3 checkPackageRuning.py dpkg -r tdengine ''' @@ -152,17 +157,17 @@ pipeline { sync_source("${BRANCH_NAME}") sh ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server + bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} python3 checkPackageRuning.py ''' } @@ -175,17 +180,17 @@ pipeline { sync_source("${BRANCH_NAME}") sh ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' 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 ${sourcePath} python3 checkPackageRuning.py ''' sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server + bash testpackage.sh ${TD_SERVER_RPM} ${version} ${BASE_TD_SERVER_TAR} ${baseVersion} server ${sourcePath} python3 checkPackageRuning.py sudo rpm -e tdengine ''' @@ -199,7 +204,7 @@ pipeline { sync_source("${BRANCH_NAME}") sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_SERVER_ARM_TAR} ${version} ${BASE_TD_SERVER_ARM_TAR} ${baseVersion} server + bash testpackage.sh ${TD_SERVER_ARM_TAR} ${version} ${BASE_TD_SERVER_ARM_TAR} ${baseVersion} server ${sourcePath} python3 checkPackageRuning.py ''' } @@ -215,7 +220,7 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_CLIENT_TAR} ${version} ${BASE_TD_CLIENT_TAR} ${baseVersion} client + bash testpackage.sh ${TD_CLIENT_TAR} ${version} ${BASE_TD_CLIENT_TAR} ${baseVersion} client ${sourcePath} python3 checkPackageRuning.py 192.168.0.21 ''' } @@ -227,7 +232,7 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_CLIENT_LITE_TAR} ${version} ${BASE_TD_CLIENT_LITE_TAR} ${baseVersion} client + bash testpackage.sh ${TD_CLIENT_LITE_TAR} ${version} ${BASE_TD_CLIENT_LITE_TAR} ${baseVersion} client ${sourcePath} python3 checkPackageRuning.py 192.168.0.24 ''' } @@ -241,7 +246,7 @@ pipeline { timeout(time: 30, unit: 'MINUTES'){ sh ''' cd ${TDENGINE_ROOT_DIR}/packaging - bash testpackage.sh ${TD_CLIENT_ARM_TAR} ${version} ${BASE_TD_CLIENT_ARM_TAR} ${baseVersion} client + bash testpackage.sh ${TD_CLIENT_ARM_TAR} ${version} ${BASE_TD_CLIENT_ARM_TAR} ${baseVersion} client ${sourcePath} python3 checkPackageRuning.py 192.168.0.21 ''' } diff --git a/packaging/testpackage.sh b/packaging/testpackage.sh index 5b9a12179deb056396e3f08d544a4478d5535005..b0e33835ddf5316d4d8374baaa657176642af181 100755 --- a/packaging/testpackage.sh +++ b/packaging/testpackage.sh @@ -6,6 +6,8 @@ version=$2 originPackageName=$3 originversion=$4 testFile=$5 +# sourcePath:web/nas +sourcePath=$6 subFile="taos.tar.gz" # Color setting @@ -71,16 +73,23 @@ fi function wgetFile { file=$1 +versionPath=$2 +sourceP=$3 +nasServerIP="192.168.1.131" +packagePath="/nas/TDengine/v${versionPath}/community" +if [ -f ${file} ];then + echoColor YD "${file} already exists ,it will delete it and download it again " + rm -rf ${file} +fi -if [ ! -f ${file} ];then - echoColor BD "wget https://www.taosdata.com/assets-download/3.0/${file}" +if [ ${sourceP} = 'web' ];then + echoColor BD "====download====:wget https://www.taosdata.com/assets-download/3.0/${file}" wget https://www.taosdata.com/assets-download/3.0/${file} -else - echoColor YD "${file} already exists and use new file " - rm -rf ${file} - echoColor BD "wget https://www.taosdata.com/assets-download/3.0/${file}" - wget https://www.taosdata.com/assets-download/3.0/${file} +elif [ ${sourceP} = 'nas' ];then + echoColor BD "====download====:scp root@${nasServerIP}:${packagePath}/${file} ." + scp root@${nasServerIP}:${packagePath}/${file} . fi + } function newPath { @@ -142,8 +151,9 @@ if [ -d ${installPath}/${tdPath} ] ;then fi echoColor G "===== download installPackage =====" -cd ${installPath} && wgetFile ${packgeName} -cd ${oriInstallPath} && wgetFile ${originPackageName} +cd ${installPath} && wgetFile ${packgeName} ${version} ${sourcePath} +cd ${oriInstallPath} && wgetFile ${originPackageName} ${originversion} ${sourcePath} + cd ${installPath} cp -r ${scriptDir}/debRpmAutoInstall.sh . @@ -193,7 +203,7 @@ elif [[ ${packgeName} =~ "tar" ]];then cd ${oriInstallPath} if [ ! -f {originPackageName} ];then echoColor YD "download base installPackage" - wgetFile ${originPackageName} + wgetFile ${originPackageName} ${originversion} ${sourcePath} fi echoColor YD "unzip the base installation package" echoColor BD "tar -xf ${originPackageName}" && tar -xf ${originPackageName} @@ -238,14 +248,19 @@ cd ${installPath} if [[ ${packgeName} =~ "Lite" ]] || ([[ ${packgeName} =~ "x64" ]] && [[ ${packgeName} =~ "client" ]]) || ([[ ${packgeName} =~ "deb" ]] && [[ ${packgeName} =~ "server" ]]) || ([[ ${packgeName} =~ "rpm" ]] && [[ ${packgeName} =~ "server" ]]) ;then echoColor G "===== install taos-tools when package is lite or client =====" cd ${installPath} - wgetFile taosTools-2.1.3-Linux-x64.tar.gz . - tar xf taosTools-2.1.3-Linux-x64.tar.gz + if [ ! -f "taosTools-2.1.3-Linux-x64.tar.gz " ];then + wgetFile taosTools-2.1.3-Linux-x64.tar.gz v2.1.3 web + tar xf taosTools-2.1.3-Linux-x64.tar.gz + fi cd taosTools-2.1.3 && bash install-taostools.sh elif ([[ ${packgeName} =~ "arm64" ]] && [[ ${packgeName} =~ "client" ]]);then echoColor G "===== install taos-tools arm when package is arm64-client =====" cd ${installPath} - wgetFile taosTools-2.1.3-Linux-arm64.tar.gz . - tar xf taosTools-2.1.3-Linux-arm64.tar.gz + if [ ! -f "taosTools-2.1.3-Linux-x64.tar.gz " ];then + wgetFile taosTools-2.1.3-Linux-x64.tar.gz v2.1.3 web + tar xf taosTools-2.1.3-Linux-arm64.tar.gz + fi + cd taosTools-2.1.3 && bash install-taostools.sh fi