From 323e26f5097423fe131fe6a570ece25dd4d817f6 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Wed, 8 Jul 2020 19:00:11 +0200 Subject: [PATCH 1/4] ci: set builds as skipped when they do not match the trigger --- .ci/apm-beats-update.groovy | 8 +++++++- .ci/packaging.groovy | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.ci/apm-beats-update.groovy b/.ci/apm-beats-update.groovy index 376ceb4190fb..1f2c0615604b 100644 --- a/.ci/apm-beats-update.groovy +++ b/.ci/apm-beats-update.groovy @@ -35,7 +35,13 @@ pipeline { when { beforeAgent true expression { - return isCommentTrigger() || isUserTrigger() + def ret = isCommentTrigger() || isUserTrigger() + if(!ret){ + currentBuild.result = 'NOT_BUILT' + currentBuild.description = "Build Skipped" + currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" + } + return ret } } /** diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 91b94221c99b..288116cb8709 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -38,7 +38,13 @@ pipeline { when { beforeAgent true expression { - return isCommentTrigger() || isUserTrigger() || isUpstreamTrigger() + def ret = isCommentTrigger() || isUserTrigger() || isUpstreamTrigger() + if(!ret){ + currentBuild.result = 'NOT_BUILT' + currentBuild.description = "Build Skipped" + currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" + } + return ret } } stages { From f50f06e0a2472f20c6a16b88368a837ab7428553 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Wed, 8 Jul 2020 19:11:40 +0200 Subject: [PATCH 2/4] Apply suggestions from code review --- .ci/apm-beats-update.groovy | 2 +- .ci/packaging.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/apm-beats-update.groovy b/.ci/apm-beats-update.groovy index 1f2c0615604b..01bf4321e729 100644 --- a/.ci/apm-beats-update.groovy +++ b/.ci/apm-beats-update.groovy @@ -38,7 +38,7 @@ pipeline { def ret = isCommentTrigger() || isUserTrigger() if(!ret){ currentBuild.result = 'NOT_BUILT' - currentBuild.description = "Build Skipped" + currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" } return ret diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 288116cb8709..a8f0b72044e5 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -41,7 +41,7 @@ pipeline { def ret = isCommentTrigger() || isUserTrigger() || isUpstreamTrigger() if(!ret){ currentBuild.result = 'NOT_BUILT' - currentBuild.description = "Build Skipped" + currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" } return ret From b970984b5136972afc88c5c20c7d4f29f143a3d7 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Thu, 9 Jul 2020 12:47:45 +0200 Subject: [PATCH 3/4] Apply suggestions from code review --- .ci/apm-beats-update.groovy | 1 + .ci/packaging.groovy | 1 + 2 files changed, 2 insertions(+) diff --git a/.ci/apm-beats-update.groovy b/.ci/apm-beats-update.groovy index 01bf4321e729..9246820c1ab7 100644 --- a/.ci/apm-beats-update.groovy +++ b/.ci/apm-beats-update.groovy @@ -40,6 +40,7 @@ pipeline { currentBuild.result = 'NOT_BUILT' currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" + echo("they build has been skipped due the trigger is a branch scan and the allow ones are manual, and GitHub comment") } return ret } diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index a8f0b72044e5..54aa2f7899d1 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -43,6 +43,7 @@ pipeline { currentBuild.result = 'NOT_BUILT' currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" + echo("they build has been skipped due the trigger is a branch scan and the allow ones are manual, GitHub comment, and upstream job") } return ret } From bfaa2ca3e75551351f263c6797d7ff8afbd319ea Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Thu, 9 Jul 2020 12:48:58 +0200 Subject: [PATCH 4/4] Apply suggestions from code review --- .ci/apm-beats-update.groovy | 2 +- .ci/packaging.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/apm-beats-update.groovy b/.ci/apm-beats-update.groovy index 9246820c1ab7..d66072fc4358 100644 --- a/.ci/apm-beats-update.groovy +++ b/.ci/apm-beats-update.groovy @@ -40,7 +40,7 @@ pipeline { currentBuild.result = 'NOT_BUILT' currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" - echo("they build has been skipped due the trigger is a branch scan and the allow ones are manual, and GitHub comment") + echo("the build has been skipped due the trigger is a branch scan and the allow ones are manual, and GitHub comment") } return ret } diff --git a/.ci/packaging.groovy b/.ci/packaging.groovy index 54aa2f7899d1..280abe2f9e7d 100644 --- a/.ci/packaging.groovy +++ b/.ci/packaging.groovy @@ -43,7 +43,7 @@ pipeline { currentBuild.result = 'NOT_BUILT' currentBuild.description = "The build has been skipped" currentBuild.displayName = "#${BUILD_NUMBER}-(Skipped)" - echo("they build has been skipped due the trigger is a branch scan and the allow ones are manual, GitHub comment, and upstream job") + 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 }