gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

There is no mention of how to use RegexBasedFilter to match desired branches and ignore branches with pipeline script

Open hellxz opened this issue 4 years ago • 0 comments

Describe your use-case which is not covered by existing documentation.

There is no mention of how to use RegexBasedFilter to match desired branches and ignore branches that do not need to trigger a build. There is no mention of using pipeline scripte to configure RegexBasedFilter. I found some useful configurations in StackOverflow but it doesn't come from official documentation, such as: https://stackoverflow.com/questions/30095583/how-do-i-configure-jenkins-to-build-all-branches-except-a-few-which-i-exclude

Useful scripts are as follows:

triggers {
    gitlab(
        triggerOnPush: true, 
        triggerOnMergeRequest: false, 
        branchFilterType: "RegexBasedFilter", 
        targetBranchRegex: '^(?:(?!feature).)*$'
    )
}

You can see that the targetBranchRegex variable is not mentioned in the documentation at all.

Can someone fix this missing piece? Thank you for all.

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

hellxz avatar Mar 30 '22 11:03 hellxz