diff options
author | Gazal K <mohamed.gazal@target.com.au> | 2017-02-07 15:26:14 +1100 |
---|---|---|
committer | Frode Aannevik <frode.aannevik@bambora.com> | 2017-02-20 00:19:30 +0100 |
commit | 066fc6386f08729ac2861e29b4bba91427541724 (patch) | |
tree | 96b0e176a0b01e9b3aa3ff1b029718c8b1f5f551 | |
parent | 725311827f86f49edcbbee1988f281dee4c6b4f2 (diff) | |
download | bbprb-066fc6386f08729ac2861e29b4bba91427541724.tar.gz |
check for disabled build for older jobs
looks like pipeline jobs don't have a disable option
-rw-r--r-- | src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketBuildTrigger.java | 10 |
1 files changed, 7 insertions, 3 deletions
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<Job<?, ?>> { @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 |