3

I'm trying to use the GIT Parameter Plug-in to list all release branches that need to go in a build process. If I use the plug-in only specifying the parameter type it works fine simple plug-in configuration

When I try to filter the list using the Branch Filter option the list appears empty. I've tried the Branch Filter field with the following values:

  • origin/release/*
  • release*
  • origin/release//*

But they all appear to be wrong.

  • As anyone ever configured such a filtering option?

If I wound like to list only my release branches ,my develop (for testing environments) and master (for production environments).

  • Is there a way to have multiple filtering?
lorenzo rantucci
  • 31
  • 1
  • 1
  • 3

2 Answers2

13

The Git Parameter plugin provides option to make use for RegEx to specify the branch or tag . Steps to be followed

  1. Tick the checkbox stating 'This project is parameterized'

  2. Specify the name of the parameter and select the parameter type (In your case branch)

  3. Click on the Advanced option , and corresponding to Branch filter fill in the RegEx origin/release/.* for release , origin/develop/.* for develop and origin/master/.* for master

You can configure multiple branch filtering based on the Regex you provide in the Branch filter option Eg-: (origin/develop|origin/release/.*) will list the origin/develop branch along with all the release branches

JakeRobb
  • 1,711
  • 1
  • 17
  • 32
achilles
  • 536
  • 5
  • 16
  • 3
    Thank you. The explanation with the plugin absolutely sucks. Clear as mud. yours is crystal clear. Great job! – Patrick Jan 24 '18 at 19:50
  • 2
    A little reminder to myself to not blindly copy paste example code as `orgin/release/.*` in point 3 should be `origin/release/.*` – devunder Feb 12 '19 at 10:13
  • I've submitted an edit correcting the typo @undersound noted. Good catch! :) – JakeRobb Aug 13 '20 at 14:29
4

The plugin seems to use standard regular expression syntax. So you have to specify your filters as:

origin/release/.*

or

.*release.*
Thomas
  • 2,231
  • 1
  • 19
  • 27