From 066fc6386f08729ac2861e29b4bba91427541724 Mon Sep 17 00:00:00 2001 From: Gazal K Date: Tue, 7 Feb 2017 15:26:14 +1100 Subject: check for disabled build for older jobs looks like pipeline jobs don't have a disable option --- .../bitbucketpullrequestbuilder/BitbucketBuildTrigger.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuildTrigger.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuildTrigger.java index 373c228..846ecb5 100644 --- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuildTrigger.java +++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuildTrigger.java @@ -253,9 +253,13 @@ public class BitbucketBuildTrigger extends Trigger> { @Override public void run() { - logger.log(Level.INFO, "TODO: check if project is disabled before calling bitbucketPullRequestsBuilder.run()"); - this.bitbucketPullRequestsBuilder.run(); - this.getDescriptor().save(); + Job project = this.getBuilder().getProject(); + if (project instanceof AbstractProject && ((AbstractProject)project).isDisabled()) { + logger.info("Build Skip."); + } else { + this.bitbucketPullRequestsBuilder.run(); + this.getDescriptor().save(); + } } @Override -- cgit v1.2.3