Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] skip stages if only docs changes #18315

Merged
merged 16 commits into from
May 8, 2020
10 changes: 10 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ pipeline {
}
}
stage('Build and Test'){
when {
beforeAgent true
expression { return env.ONLY_DOCS == "false" }
}
failFast false
parallel {
stage('Elastic Agent x-pack'){
Expand Down Expand Up @@ -1100,6 +1104,12 @@ def loadConfigEnvVars(){
generatorPatterns.addAll(getVendorPatterns('generator/common/beatgen'))
generatorPatterns.addAll(getVendorPatterns('metricbeat/beater'))
env.BUILD_GENERATOR = isChangedOSSCode(generatorPatterns)

// Skip all the stages for only the Pull Requests that contain only changes in asciidoc
// and png files.
env.ONLY_DOCS = !params.runAllStages &&
!env.CHANGE_ID?.trim() &&
v1v marked this conversation as resolved.
Show resolved Hide resolved
isGitRegionMatch(patterns: [ '.*\\.(asciidoc|png|Jenkinsfile)' ], shouldMatchAll: true)
}

/**
Expand Down