Skip to content

Commit

Permalink
ci: set builds as skipped when they do not match the trigger (elastic…
Browse files Browse the repository at this point in the history
…#19750)

* ci: set builds as skipped when they do not match the trigger

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review
  • Loading branch information
kuisathaverat authored and melchiormoulin committed Oct 14, 2020
1 parent 21b5160 commit 61b0b13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .ci/apm-beats-update.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ pipeline {
when {
beforeAgent true
expression {
return isCommentTrigger() || isUserTrigger()
def ret = isCommentTrigger() || isUserTrigger()
if(!ret){
currentBuild.result = 'NOT_BUILT'
currentBuild.description = "The build has been skipped"
currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)"
echo("the build has been skipped due the trigger is a branch scan and the allow ones are manual, and GitHub comment")
}
return ret
}
}
/**
Expand Down
9 changes: 8 additions & 1 deletion .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ pipeline {
when {
beforeAgent true
expression {
return isCommentTrigger() || isUserTrigger() || isUpstreamTrigger()
def ret = isCommentTrigger() || isUserTrigger() || isUpstreamTrigger()
if(!ret){
currentBuild.result = 'NOT_BUILT'
currentBuild.description = "The build has been skipped"
currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)"
echo("the build has been skipped due the trigger is a branch scan and the allow ones are manual, GitHub comment, and upstream job")
}
return ret
}
}
stages {
Expand Down

0 comments on commit 61b0b13

Please sign in to comment.