Skip to content

Commit

Permalink
[FIXED JENKINS-48792] A branch build strategy that only builds named …
Browse files Browse the repository at this point in the history
…branches
  • Loading branch information
stephenc committed Jan 4, 2018
1 parent 4587d9c commit 947b4fc
Show file tree
Hide file tree
Showing 28 changed files with 1,136 additions and 0 deletions.
Binary file added docs/images/named-branches-exact.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/named-branches-regex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/named-branches-wildcards.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/named-branches.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/user.adoc
Expand Up @@ -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[]
Expand Down
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -89,6 +90,7 @@ public String toString() {
/**
* Our descriptor.
*/
@Symbol("buildRegularBranches")
@Extension
public static class DescriptorImpl extends BranchBuildStrategyDescriptor {
/**
Expand Down
Expand Up @@ -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;

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

0 comments on commit 947b4fc

Please sign in to comment.