Skip to content
Permalink
Browse files

Merge pull request #1 from stephenc/jenkins-48792

[FIXED JENKINS-48792] A branch build strategy that only builds named branches
  • Loading branch information...
stephenc committed Jan 4, 2018
2 parents 4587d9c + 93a7950 commit 7011701f3bf9aaeebc523c685a35e18e9fff5cea
Showing with 1,141 additions and 1 deletion.
  1. +5 −1 CHANGES.adoc
  2. BIN docs/images/named-branches-exact.png
  3. BIN docs/images/named-branches-regex.png
  4. BIN docs/images/named-branches-wildcards.png
  5. BIN docs/images/named-branches.png
  6. +24 −0 docs/user.adoc
  7. +2 −0 src/main/java/jenkins/branch/buildstrategies/basic/BranchBuildStrategyImpl.java
  8. +2 −0 src/main/java/jenkins/branch/buildstrategies/basic/ChangeRequestBuildStrategyImpl.java
  9. +449 −0 src/main/java/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl.java
  10. +2 −0 src/main/java/jenkins/branch/buildstrategies/basic/TagBuildStrategyImpl.java
  11. +4 −0 src/main/resources/jenkins/branch/buildstrategies/basic/Messages.properties
  12. +32 −0 ...es/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/ExactNameFilter/config.jelly
  13. +26 −0 ...branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/ExactNameFilter/help-caseSensitive.html
  14. +26 −0 .../jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/ExactNameFilter/help-name.html
  15. +26 −0 ...urces/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/ExactNameFilter/help.html
  16. +32 −0 ...es/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/RegexNameFilter/config.jelly
  17. +26 −0 ...branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/RegexNameFilter/help-caseSensitive.html
  18. +27 −0 ...jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/RegexNameFilter/help-regex.html
  19. +26 −0 ...urces/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/RegexNameFilter/help.html
  20. +35 −0 ...enkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/WildcardsNameFilter/config.jelly
  21. +26 −0 ...ch/buildstrategies/basic/NamedBranchBuildStrategyImpl/WildcardsNameFilter/help-caseSensitive.html
  22. +27 −0 .../branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/WildcardsNameFilter/help-excludes.html
  23. +27 −0 .../branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/WildcardsNameFilter/help-includes.html
  24. +26 −0 ...s/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/WildcardsNameFilter/help.html
  25. +29 −0 src/main/resources/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/config.jelly
  26. +26 −0 ...ain/resources/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/help-filters.html
  27. +26 −0 src/main/resources/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImpl/help.html
  28. +27 −0 src/test/java/jenkins/branch/buildstrategies/basic/FormBindingTest.java
  29. +183 −0 src/test/java/jenkins/branch/buildstrategies/basic/NamedBranchBuildStrategyImplTest.java
@@ -12,10 +12,14 @@ Template:
////
== Version 1.0.1 (unreleased)
== Version 1.0.2 (unreleased)
* ...
== Version 1.0.1 (2018-01-04)
* https://issues.jenkins-ci.org/browse/JENKINS-48792[JENKINS-48792] A branch build strategy that only builds named branches.
== Version 1.0.0 (2018-01-04)
* Initial release
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,6 +21,30 @@ image::images/branches.png[]
This strategy will build "regular" branches (also known as streams in some source control systems).
In otherwords, if it is not a change request and if it is not a tag, then it should be built on initial discovery and every time a revision change is detected.

==== Named branches

image::images/named-branches.png[]

This strategy will build "regular" branches (also known as streams in some source control systems) if the name of the branch matches one of an ordered list of match rules.

There name matching rules are an extension point.
This plugin provides three implementations:

Exact name::
Matches the branch name exactly without any wildcard or special character substitution.
+
image::images/named-branches-exact.png[]

Regular expression::
Matches the branch name against a https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html[Java regular expression].
+
image::images/named-branches-regex.png[]

Wildcard include/exclude::
Matches the branch name against pair of simple wildcard style include/exclude rules.
+
image::images/named-branches-wildcards.png[]

==== Change requests

image::images/change-requests.png[]
@@ -32,6 +32,7 @@
import jenkins.scm.api.SCMSource;
import jenkins.scm.api.mixin.ChangeRequestSCMHead;
import jenkins.scm.api.mixin.TagSCMHead;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

/**
@@ -89,6 +90,7 @@ public String toString() {
/**
* Our descriptor.
*/
@Symbol("buildRegularBranches")
@Extension
public static class DescriptorImpl extends BranchBuildStrategyDescriptor {
/**
@@ -35,6 +35,7 @@
import jenkins.scm.api.mixin.ChangeRequestSCMHead;
import jenkins.scm.api.mixin.ChangeRequestSCMHead2;
import jenkins.scm.api.mixin.ChangeRequestSCMRevision;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

/**
@@ -119,6 +120,7 @@ public String toString() {
/**
* Our descriptor.
*/
@Symbol("buildChangeRequests")
@Extension
public static class DescriptorImpl extends BranchBuildStrategyDescriptor {
/**

0 comments on commit 7011701

Please sign in to comment.
You can’t perform that action at this time.