未验证 提交 b2afad22 编写于 作者: Y Yiqing Liu 提交者: GitHub

remove auto checkout (#8388)

* remove auto checkout

* remove ci skip

* update
上级 6cba6093
import hudson.model.Result import hudson.model.Result
import hudson.model.*; import hudson.model.*;
import jenkins.model.CauseOfInterruption import jenkins.model.CauseOfInterruption
properties([pipelineTriggers([githubPush()])])
node { node {
git url: 'https://github.com/taosdata/TDengine.git'
} }
def skipbuild=0 def skipbuild=0
...@@ -194,6 +192,7 @@ def pre_test_win(){ ...@@ -194,6 +192,7 @@ def pre_test_win(){
} }
pipeline { pipeline {
agent none agent none
options { skipDefaultCheckout() }
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'
...@@ -201,6 +200,7 @@ pipeline { ...@@ -201,6 +200,7 @@ pipeline {
stages { stages {
stage('pre_build'){ stage('pre_build'){
agent{label 'master'} agent{label 'master'}
options { skipDefaultCheckout() }
when{ when{
changeRequest() changeRequest()
} }
...@@ -209,52 +209,51 @@ pipeline { ...@@ -209,52 +209,51 @@ pipeline {
abort_previous() abort_previous()
abortPreviousBuilds() abortPreviousBuilds()
} }
sh''' // sh'''
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 // git fetch
''' // '''
script { // script {
if (env.CHANGE_TARGET == 'master') { // if (env.CHANGE_TARGET == 'master') {
sh ''' // sh '''
git checkout master // git checkout master
''' // '''
} // }
else if(env.CHANGE_TARGET == '2.0'){ // else if(env.CHANGE_TARGET == '2.0'){
sh ''' // sh '''
git checkout 2.0 // git checkout 2.0
''' // '''
} // }
else{ // else{
sh ''' // sh '''
git checkout develop // git checkout develop
''' // '''
} // }
} // }
sh''' // sh'''
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
options { skipDefaultCheckout() }
when { when {
allOf{ allOf{
changeRequest() changeRequest()
expression{
return skipbuild.trim() == '2'
}
not{ expression { env.CHANGE_BRANCH =~ /docs\// }} not{ expression { env.CHANGE_BRANCH =~ /docs\// }}
} }
} }
...@@ -262,7 +261,6 @@ pipeline { ...@@ -262,7 +261,6 @@ pipeline {
stage('python_1_s1') { stage('python_1_s1') {
agent{label " slave1 || slave11 "} agent{label " slave1 || slave11 "}
steps { steps {
pre_test() pre_test()
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 55, unit: 'MINUTES'){
sh ''' sh '''
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册