提交 2f1bd585 编写于 作者: L liuyq-617

fix changing target branch

上级 ba76fe98
...@@ -6,6 +6,7 @@ node { ...@@ -6,6 +6,7 @@ node {
} }
def skipstage=0 def skipstage=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()
...@@ -24,7 +25,7 @@ def abortPreviousBuilds() { ...@@ -24,7 +25,7 @@ def abortPreviousBuilds() {
build.doKill() //doTerm(),doKill(),doTerm() build.doKill() //doTerm(),doKill(),doTerm()
} }
} }
//abort previous build // abort previous build
abortPreviousBuilds() abortPreviousBuilds()
def abort_previous(){ def abort_previous(){
def buildNumber = env.BUILD_NUMBER as int def buildNumber = env.BUILD_NUMBER as int
...@@ -33,19 +34,29 @@ def abort_previous(){ ...@@ -33,19 +34,29 @@ def abort_previous(){
} }
def pre_test(){ def pre_test(){
sh ''' sh '''
sudo rmtaos || echo "taosd has not installed" sudo rmtaos || echo "taosd has not installed"
''' '''
sh ''' sh '''
killall -9 taosd ||echo "no taosd running"
killall -9 gdb || echo "no gdb running"
cd ${WKC} cd ${WKC}
git checkout develop
git reset --hard HEAD~10 >/dev/null git reset --hard HEAD~10 >/dev/null
'''
script {
if (env.CHANGE_TARGET == 'master') {
sh 'git checkout master'
}
else {
sh 'git checkout develop'
}
}
sh'''
git pull >/dev/null git pull >/dev/null
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
git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD develop)|grep -v -E '.*md|//src//connector|Jenkinsfile' git clean -dfx
find ${WKC}/tests/pytest -name \'*\'.sql -exec rm -rf {} \\;
cd ${WK} cd ${WK}
git reset --hard HEAD~10 git reset --hard HEAD~10
''' '''
...@@ -62,7 +73,7 @@ def pre_test(){ ...@@ -62,7 +73,7 @@ def pre_test(){
cd ${WK} cd ${WK}
export TZ=Asia/Harbin export TZ=Asia/Harbin
date date
rm -rf ${WK}/debug git clean -dfx
mkdir debug mkdir debug
cd debug cd debug
cmake .. > /dev/null cmake .. > /dev/null
...@@ -88,6 +99,10 @@ pipeline { ...@@ -88,6 +99,10 @@ pipeline {
changeRequest() changeRequest()
} }
steps { steps {
script{
abort_previous()
abortPreviousBuilds()
}
sh''' sh'''
cp -r ${WORKSPACE} ${WORKSPACE}.tes cp -r ${WORKSPACE} ${WORKSPACE}.tes
cd ${WORKSPACE}.tes cd ${WORKSPACE}.tes
...@@ -189,6 +204,12 @@ pipeline { ...@@ -189,6 +204,12 @@ pipeline {
rm -rf /var/log/taos/* rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh ./handle_crash_gen_val_log.sh
''' '''
sh '''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_taosd_val_log.sh
'''
timeout(time: 45, unit: 'MINUTES'){ timeout(time: 45, unit: 'MINUTES'){
sh ''' sh '''
date date
...@@ -219,6 +240,11 @@ pipeline { ...@@ -219,6 +240,11 @@ pipeline {
cd ${WKC}/tests cd ${WKC}/tests
./test-all.sh b3fq ./test-all.sh b3fq
date''' date'''
sh '''
date
cd ${WKC}/tests
./test-all.sh full example
date'''
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册