Skip to content

Commit

Permalink
ci: Change comment trigger detection method (elastic#19827)
Browse files Browse the repository at this point in the history
* test: check which trigger is enabled

* chore: merge master

* test: test a fix

* test: change the comment trigger detection method

* test: change the comment trigger detection method

* Update .ci/packaging.groovy

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>

Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
  • Loading branch information
kuisathaverat and v1v committed Jul 14, 2020
1 parent a1e5965 commit 7447dc5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 11 additions & 8 deletions .ci/apm-beats-update.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ pipeline {
agent { label 'ubuntu && immutable' }
when {
beforeAgent true
expression {
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")
anyOf {
triggeredBy cause: "IssueCommentCause"
expression {
def ret = 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
}
return ret
}
}
/**
Expand Down
19 changes: 11 additions & 8 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ pipeline {
agent { label 'ubuntu && immutable' }
when {
beforeAgent true
expression {
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")
anyOf {
triggeredBy cause: "IssueCommentCause"
expression {
def ret = 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
}
return ret
}
}
stages {
Expand Down

0 comments on commit 7447dc5

Please sign in to comment.