I defined a parameterized job (freestyle job, then checked the box for "This
build is parameterized") and assigned a parameter "branch" with a default
value "master".

In the "Branches to build" field, I placed the text "${branch}".  The job
then built the 2.2.x branch when I ran the job with a value of 2.2.x.

I believe there is also a git parameters plugin which may be able to
present a pick list of allowed values, instead of the free form text that I
had to use.

Mark Waite

On Tue, Oct 21, 2014 at 12:46 PM, Kanstantsin Shautsou <
[email protected]> wrote:

> Have you tried use "Input String parameter" and set in branches this
> ${variable}?
>
>
> On Tuesday, October 21, 2014 5:55:53 PM UTC+3, Ivan Kanis wrote:
>>
>> Hello,
>>
>> We are trying to specify a git branch on a parameterized build.
>>
>> It seems there are options for CVS and Subversion but not for git.
>>
>> However when we are debugging the git plugin there seems to be support
>> for
>> it. In the function determineRevisionToBuild there is the following
>> code:
>>
>> // parameter forcing the commit ID to build
>> if (candidates.isEmpty() ) {
>>     final RevisionParameterAction rpa = build.getAction(
>> RevisionParameterAction.class);
>>     if (rpa != null) {
>>         candidates = Collections.singleton(rpa.toRevision(git));
>>     }
>> }
>>
>> We can not find a way to set RevisionParameterAction.
>>
>> Have we missed something obvious?
>>
>> Ivan
>>
>> --
>> We are all a little weird and life's a little weird, and when we find
>> someone whose weirdness is compatible with ours, we join up with them
>> and fall in mutual weirdness and call it love.
>>     -- Dr. Seuss
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks!
Mark Waite

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to