diff options
author | S.nishio <nishio@densan-labs.net> | 2014-04-16 01:51:07 +0900 |
---|---|---|
committer | S.nishio <nishio@densan-labs.net> | 2014-04-16 01:51:07 +0900 |
commit | 66c0756daf276f214061667ce2b47d036eb3fa8a (patch) | |
tree | 19d78a56c8aba1de872b8abc693039637bef0fc2 /src/main/java/bitbucketpullrequestbuilder | |
parent | 29b265fae640e9aa3de273feadacc764cc7f39fb (diff) | |
download | bbprb-66c0756daf276f214061667ce2b47d036eb3fa8a.tar.gz |
repository: add ci skip function
Diffstat (limited to 'src/main/java/bitbucketpullrequestbuilder')
-rw-r--r-- | src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java index ec13f38..4889dcf 100644 --- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java +++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java @@ -89,6 +89,9 @@ public class BitbucketRepository { private boolean isBuildTarget(BitbucketPullRequestResponseValue pullRequest) { boolean shouldBuild = true; if (pullRequest.getState() != null && pullRequest.getState().equals("OPEN")) { + if (isSkipBuild(pullRequest.getTitle())) { + return false; + } BitbucketPullRequestResponseValueRepository destination = pullRequest.getDestination(); String owner = destination.getRepository().getOwnerName(); String repositoryName = destination.getRepository().getRepositoryName(); @@ -116,4 +119,17 @@ public class BitbucketRepository { } return shouldBuild; } + + private boolean isSkipBuild(String pullRequestTitle) { + String skipPhrases = this.trigger.getCiSkipPhrases(); + if (skipPhrases != null) { + String[] phrases = skipPhrases.split(","); + for(String phrase : phrases) { + if (pullRequestTitle.toLowerCase().contains(phrase.trim().toLowerCase())) { + return true; + } + } + } + return false; + } } |