Skip to content

Commit

Permalink
[7.12](backport #25864) ci: exclude builds with changes on the k8s te…
Browse files Browse the repository at this point in the history
…mplates files (#25943)
  • Loading branch information
mergify[bot] authored Jun 23, 2021
1 parent ad1c0e1 commit 2b3b928
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,18 @@ pipeline {
steps {
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ])
deleteDir()
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true)
// Here we do a checkout into a temporary directory in order to have the
// side-effect of setting up the git environment correctly.
gitCheckout(basedir: "${pwd(tmp: true)}", githubNotifyFirstTimeContributor: true)
dir("${BASE_DIR}") {
// We use a raw checkout to avoid the many extra objects which are brought in
// with a `git fetch` as would happen if we used the `gitCheckout` step.
checkout scm
}
stashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
dir("${BASE_DIR}"){
// Skip all the stages except docs for PR's with asciidoc and md changes only
setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '.*\\.(asciidoc|md)' ], shouldMatchAll: true).toString())
// Skip all the stages except docs for PR's with asciidoc, md or deploy k8s templates changes only
setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '(.*\\.(asciidoc|md)|deploy/kubernetes/.*-kubernetes\\.yaml)' ], shouldMatchAll: true).toString())
setEnvVar('GO_MOD_CHANGES', isGitRegionMatch(patterns: [ '^go.mod' ], shouldMatchAll: false).toString())
setEnvVar('PACKAGING_CHANGES', isGitRegionMatch(patterns: [ '^dev-tools/packaging/.*' ], shouldMatchAll: false).toString())
setEnvVar('GO_VERSION', readFile(".go-version").trim())
Expand Down

0 comments on commit 2b3b928

Please sign in to comment.