Awesome! That worked.

Thanks a ton! :)

Sagu



On Tue, Apr 22, 2014 at 3:16 PM, Marc MacIntyre <[email protected]>wrote:

> Ugh, should have read
> p = params.get('PARAM_NAME', 'DEFAULT_VALUE')
>
>
> On Tue, Apr 22, 2014 at 3:15 PM, Marc MacIntyre 
> <[email protected]>wrote:
>
>> params = params.get('PARAM_NAME', 'DEFAULT_VALUE')
>>
>>
>> On Tue, Apr 22, 2014 at 3:12 PM, Svg Feert <[email protected]> wrote:
>>
>>> Sorry Marc, I don't understand how to do that.
>>>
>>> For other regular jobs I simply access parameters as environment
>>> variables (by asking the jobs to execute a shell script).
>>>
>>> I can't do that in the DSL for bf2, and trying to print $param1 doesn't
>>> work.
>>>
>>> How do I access that parameter in bf2? Any help you can give will be
>>> greatly appreciated.
>>>
>>> Sagu
>>>
>>>
>>>
>>>
>>> On Tue, Apr 22, 2014 at 3:05 PM, Marc MacIntyre <[email protected]
>>> > wrote:
>>>
>>>> You want to get the parameter, not the environment variable.
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Apr 22, 2014, at 3:03 PM, Svg Feert <[email protected]> wrote:
>>>>
>>>> Thanks Marc.
>>>>
>>>> I added this in the bf1 DSL:
>>>> build( "bf2", param1: 'asd')
>>>>
>>>> Then in bf2:
>>>> - I checked the 'This build is parameterized' box
>>>> - I specified the param name as param1 and did not give a default value.
>>>> - In the DSL I said:
>>>> def env=System.getenv()
>>>> env.each{
>>>> println it
>>>> }
>>>>
>>>> When bf2 runs, I see a bunch of environment variables, but not param1.
>>>>
>>>> Can you please tell me where I am going wrong?
>>>>
>>>> Thanks,
>>>> Sagu
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, Apr 22, 2014 at 2:52 PM, Marc MacIntyre <
>>>> [email protected]> wrote:
>>>>
>>>>> You need both of those solutions: set up bf2 to take the parameters
>>>>> you want, and have bf1 pass them in.
>>>>>
>>>>>
>>>>> On Tue, Apr 22, 2014 at 2:51 PM, Sagu Feert <[email protected]>wrote:
>>>>>
>>>>>> I have 2 build flow jobs: bf1 and bf2.
>>>>>> bf1 triggers bf2, and I'd like bf1 to pass some environment variables
>>>>>> to bf2.
>>>>>>
>>>>>> I tried using the 'Parameterized Trigger Plug-in' to pass variables
>>>>>> between the two and that didn't work.
>>>>>>
>>>>>> I also tried triggering bf2 in the bf1 DSL like this:
>>>>>> build( "bf2", param1: someParam)
>>>>>>
>>>>>> and that didn't work either.
>>>>>>
>>>>>> Is this simply not possible?
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Jenkins Users" 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.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Marc MacIntyre
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to a topic in the
>>>>> Google Groups "Jenkins Users" group.
>>>>> To unsubscribe from this topic, visit
>>>>> https://groups.google.com/d/topic/jenkinsci-users/sq9M0mtcIYo/unsubscribe
>>>>> .
>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>> [email protected].
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Jenkins Users" 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.
>>>>
>>>>  --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Jenkins Users" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/jenkinsci-users/sq9M0mtcIYo/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" 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.
>>>
>>
>>
>>
>> --
>> Marc MacIntyre
>>
>
>
>
> --
> Marc MacIntyre
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/sq9M0mtcIYo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" 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