Skip to content

Commit

Permalink
fix: checkout with tags (#2908)
Browse files Browse the repository at this point in the history
checkout code with tags in qa-release-test pipelines.

---------

Signed-off-by: purelind <purelind@gmail.com>
  • Loading branch information
purelind committed Apr 12, 2024
1 parent b236c91 commit 4b25f53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
17 changes: 6 additions & 11 deletions pipelines/qa/qa-release-br-integration-test.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// REF: https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline
// Keep small than 400 lines: https://issues.jenkins.io/browse/JENKINS-37984
// should triggerd for release-8.1 branches
@Library('tipipeline') _

final K8S_NAMESPACE = "jenkins-tidb"
final GIT_FULL_REPO_NAME = 'pingcap/tidb'
Expand Down Expand Up @@ -41,16 +42,11 @@ pipeline {
options { timeout(time: 10, unit: 'MINUTES') }
steps {
dir("tidb") {
checkout (changelog: false, poll: false, scm: [
$class : 'GitSCM',
branches : [[name: "${params.RELEASE_BRANCH}"]],
userRemoteConfigs: [[
refspec: "+refs/heads/${params.RELEASE_BRANCH}" + ":refs/remotes/origin/${params.RELEASE_BRANCH}",
url: 'https://github.com/pingcap/tidb.git',
]],
extensions: [[$class: 'PruneStaleBranch'], [$class: 'CleanBeforeCheckout'],
[$class: 'CloneOption',shallow: true,depth: 1,timeout: 10]],
])
retry(2) {
script {
component.checkoutWithMergeBase('https://github.com/pingcap/tidb.git', 'tidb', "${params.RELEASE_BRANCH}", '', trunkBranch="${params.RELEASE_BRANCH}", timeout=5, credentialsId="")
}
}
}
}
}
Expand Down Expand Up @@ -109,7 +105,6 @@ pipeline {
}
stages {
stage("Test") {
options { timeout(time: 45, unit: 'MINUTES') }
steps {
dir('tidb') {
cache(path: "./", includes: '**/*', key: "ws/${BUILD_TAG}/br-tests") {
Expand Down
18 changes: 6 additions & 12 deletions pipelines/qa/qa-release-lightning-integration-test.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// REF: https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline
// Keep small than 400 lines: https://issues.jenkins.io/browse/JENKINS-37984
// should triggerd for master branches
@Library('tipipeline') _

final K8S_NAMESPACE = "jenkins-tidb"
final GIT_FULL_REPO_NAME = 'pingcap/tidb'
Expand Down Expand Up @@ -40,16 +41,11 @@ pipeline {
options { timeout(time: 5, unit: 'MINUTES') }
steps {
dir("tidb") {
checkout (changelog: false, poll: false, scm: [
$class : 'GitSCM',
branches : [[name: "${params.RELEASE_BRANCH}"]],
userRemoteConfigs: [[
refspec: "+refs/heads/${params.RELEASE_BRANCH}" + ":refs/remotes/origin/${params.RELEASE_BRANCH}",
url: 'https://github.com/pingcap/tidb.git',
]],
extensions: [[$class: 'PruneStaleBranch'], [$class: 'CleanBeforeCheckout'],
[$class: 'CloneOption',shallow: true,depth: 1,timeout: 10]],
])
retry(2) {
script {
component.checkoutWithMergeBase('https://github.com/pingcap/tidb.git', 'tidb', "${params.RELEASE_BRANCH}", '', trunkBranch="${params.RELEASE_BRANCH}", timeout=5, credentialsId="")
}
}
}
}
}
Expand Down Expand Up @@ -107,8 +103,6 @@ pipeline {
}
stages {
stage("Test") {
environment { CODECOV_TOKEN = credentials('codecov-token-tidb') }
options { timeout(time: 45, unit: 'MINUTES') }
steps {
dir('tidb') {
cache(path: "./", includes: '**/*', key: "ws/${BUILD_TAG}/lightning-test") {
Expand Down

0 comments on commit 4b25f53

Please sign in to comment.