Skip to content

Commit

Permalink
[CI] Support skip-ci label (#21377) (#21784)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 15, 2020
1 parent 2c67862 commit 992d9c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
14 changes: 9 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,17 @@ pipeline {
script {
def mapParallelTasks = [:]
def content = readYaml(file: 'Jenkinsfile.yml')
content['projects'].each { projectName ->
generateStages(project: projectName, changeset: content['changeset']).each { k,v ->
mapParallelTasks["${k}"] = v
if (content?.disabled?.when?.labels && beatsWhen(project: 'top-level', content: content?.disabled?.when)) {
error 'Pull Request has been configured to be disabled when there is a skip-ci label match'
} else {
content['projects'].each { projectName ->
generateStages(project: projectName, changeset: content['changeset']).each { k,v ->
mapParallelTasks["${k}"] = v
}
}
notifyBuildReason()
parallel(mapParallelTasks)
}
notifyBuildReason()
parallel(mapParallelTasks)
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ changeset:
- "^testing/.*"
- "^x-pack/libbeat/.*"

## Proposal
## TBC: This will allow to configure what to do based on the PR configuration
disabled:
when:
labels: ## Skip the GitHub Pull Request builds if there is a GitHub label match
- "skip-ci"
draft: true ## Skip the GitHub Pull Request builds with Draft PRs.
labels: ## Skip the GitHub Pull Request builds if any of the given GitHub labels match with the assigned labels in the PR.
- skip-ci
## TODO: This will allow to configure what to do based on the PR configuration
draft: true ## Skip the GitHub Pull Request builds with Draft PRs.

0 comments on commit 992d9c3

Please sign in to comment.