Skip to content

Commit

Permalink
Merge pull request #1 from stephenc/jenkins-48792
Browse files Browse the repository at this point in the history
[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 7011701
Show file tree
Hide file tree
Showing 29 changed files with 1,141 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGES.adoc
Expand Up @@ -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 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 7011701

Please sign in to comment.