Skip to content

Commit

Permalink
test: change the comment trigger detection method
Browse files Browse the repository at this point in the history
  • Loading branch information
kuisathaverat committed Jul 13, 2020
1 parent debded8 commit 6ccfb7f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 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
20 changes: 11 additions & 9 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ pipeline {
agent { label 'ubuntu && immutable' }
when {
beforeAgent true
expression {
echo "C: ${isCommentTrigger()} - U: ${isUserTrigger()} - UP: ${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")
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 6ccfb7f

Please sign in to comment.