提交 5f8e3750 编写于 作者: L liuyq-617

test

上级 dda0e6e3
...@@ -4,9 +4,6 @@ properties([pipelineTriggers([githubPush()])]) ...@@ -4,9 +4,6 @@ properties([pipelineTriggers([githubPush()])])
node { node {
git url: 'https://github.com/taosdata/TDengine.git' git url: 'https://github.com/taosdata/TDengine.git'
} }
def skipbuild=0
def abortPreviousBuilds() { def abortPreviousBuilds() {
def currentJobName = env.JOB_NAME def currentJobName = env.JOB_NAME
def currentBuildNumber = env.BUILD_NUMBER.toInteger() def currentBuildNumber = env.BUILD_NUMBER.toInteger()
...@@ -33,7 +30,6 @@ def abort_previous(){ ...@@ -33,7 +30,6 @@ def abort_previous(){
milestone(buildNumber) milestone(buildNumber)
} }
def pre_test(){ def pre_test(){
sh'hostname' sh'hostname'
sh ''' sh '''
sudo rmtaos || echo "taosd has not installed" sudo rmtaos || echo "taosd has not installed"
...@@ -52,12 +48,18 @@ def pre_test(){ ...@@ -52,12 +48,18 @@ def pre_test(){
git checkout master git checkout master
''' '''
} }
else { else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout develop git checkout 2.0
''' '''
} }
else{
sh '''
cd ${WKC}
git checkout develop
'''
}
} }
sh''' sh'''
cd ${WKC} cd ${WKC}
...@@ -75,7 +77,13 @@ def pre_test(){ ...@@ -75,7 +77,13 @@ def pre_test(){
git checkout master git checkout master
''' '''
} }
else { else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.0
'''
}
else{
sh ''' sh '''
cd ${WK} cd ${WK}
git checkout develop git checkout develop
...@@ -95,19 +103,17 @@ def pre_test(){ ...@@ -95,19 +103,17 @@ def pre_test(){
make > /dev/null make > /dev/null
make install > /dev/null make install > /dev/null
cd ${WKC}/tests cd ${WKC}/tests
pip3 install ${WKC}/src/connector/python pip3 install ${WKC}/src/connector/python/
''' '''
return 1 return 1
} }
pipeline { pipeline {
agent none agent none
environment{ environment{
WK = '/var/lib/jenkins/workspace/TDinternal' WK = '/var/lib/jenkins/workspace/TDinternal'
WKC= '/var/lib/jenkins/workspace/TDinternal/community' WKC= '/var/lib/jenkins/workspace/TDinternal/community'
} }
stages { stages {
stage('pre_build'){ stage('pre_build'){
agent{label 'master'} agent{label 'master'}
...@@ -123,19 +129,22 @@ pipeline { ...@@ -123,19 +129,22 @@ pipeline {
rm -rf ${WORKSPACE}.tes rm -rf ${WORKSPACE}.tes
cp -r ${WORKSPACE} ${WORKSPACE}.tes cp -r ${WORKSPACE} ${WORKSPACE}.tes
cd ${WORKSPACE}.tes cd ${WORKSPACE}.tes
git fetch
''' '''
script { script {
if (env.CHANGE_TARGET == 'master') { if (env.CHANGE_TARGET == 'master') {
sh ''' sh '''
git checkout master git checkout master
git pull origin master
''' '''
} }
else { else if(env.CHANGE_TARGET == '2.0'){
sh '''
git checkout 2.0
'''
}
else{
sh ''' sh '''
git checkout develop git checkout develop
git pull origin develop
''' '''
} }
} }
...@@ -143,34 +152,31 @@ pipeline { ...@@ -143,34 +152,31 @@ pipeline {
git fetch origin +refs/pull/${CHANGE_ID}/merge git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD git checkout -qf FETCH_HEAD
''' '''
script{ script{
skipbuild='2' skipbuild='2'
skipbuild=sh(script: "git log -2 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]' && echo 1 || echo 2", returnStdout:true) skipbuild=sh(script: "git log -2 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]' && echo 1 || echo 2", returnStdout:true)
println skipbuild println skipbuild
} }
sh''' sh'''
rm -rf ${WORKSPACE}.tes rm -rf ${WORKSPACE}.tes
''' '''
} }
} }
stage('Parallel test stage') { stage('Parallel test stage') {
//only build pr //only build pr
when { when {
allOf { allOf{
changeRequest() changeRequest()
expression{ expression{
return skipbuild.trim() == '2' return skipbuild.trim() == '2'
} }
} }
} }
parallel { parallel {
stage('python_1_s1') { stage('python_1_s1') {
agent any agent{label " slave1 || slave11 "}
steps { steps {
pre_test() pre_test()
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
sh ''' sh '''
...@@ -183,7 +189,7 @@ pipeline { ...@@ -183,7 +189,7 @@ pipeline {
} }
} }
stage('python_2_s5') { stage('python_2_s5') {
agent any agent{label " slave5 || slave15 "}
steps { steps {
pre_test() pre_test()
...@@ -197,7 +203,7 @@ pipeline { ...@@ -197,7 +203,7 @@ pipeline {
} }
} }
stage('python_3_s6') { stage('python_3_s6') {
agent any agent{label " slave6 || slave16 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -210,7 +216,7 @@ pipeline { ...@@ -210,7 +216,7 @@ pipeline {
} }
} }
stage('test_b1_s2') { stage('test_b1_s2') {
agent any agent{label " slave2 || slave12 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -221,9 +227,9 @@ pipeline { ...@@ -221,9 +227,9 @@ pipeline {
} }
} }
} }
stage('test_crash_gen_s3') { stage('test_crash_gen_s3') {
agent any agent{label " slave3 || slave13 "}
steps { steps {
pre_test() pre_test()
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
...@@ -255,13 +261,12 @@ pipeline { ...@@ -255,13 +261,12 @@ pipeline {
./test-all.sh b2fq ./test-all.sh b2fq
date date
''' '''
} }
} }
} }
stage('test_valgrind_s4') { stage('test_valgrind_s4') {
agent any agent{label " slave4 || slave14 "}
steps { steps {
pre_test() pre_test()
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
...@@ -286,7 +291,7 @@ pipeline { ...@@ -286,7 +291,7 @@ pipeline {
} }
} }
stage('test_b4_s7') { stage('test_b4_s7') {
agent any agent{label " slave7 || slave17 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -305,7 +310,7 @@ pipeline { ...@@ -305,7 +310,7 @@ pipeline {
} }
} }
stage('test_b5_s8') { stage('test_b5_s8') {
agent any agent{label " slave8 || slave18 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -318,7 +323,7 @@ pipeline { ...@@ -318,7 +323,7 @@ pipeline {
} }
} }
stage('test_b6_s9') { stage('test_b6_s9') {
agent any agent{label " slave9 || slave19 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -331,7 +336,7 @@ pipeline { ...@@ -331,7 +336,7 @@ pipeline {
} }
} }
stage('test_b7_s10') { stage('test_b7_s10') {
agent any agent{label " slave10 || slave20 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -423,6 +428,5 @@ pipeline { ...@@ -423,6 +428,5 @@ pipeline {
from: "support@taosdata.com" from: "support@taosdata.com"
) )
} }
} }
}
} \ No newline at end of file
...@@ -18108,4 +18108,4 @@ ...@@ -18108,4 +18108,4 @@
fun:_PyEval_EvalFrameDefault fun:_PyEval_EvalFrameDefault
fun:_PyEval_EvalCodeWithName fun:_PyEval_EvalCodeWithName
fun:_PyFunction_Vectorcall fun:_PyFunction_Vectorcall
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册