Re: Access Environment variables

2015-10-29 Thread Ullrich Hafner
Yes.

You can get the variables e.g. from the current build:
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L2207
 



> Am 29.10.2015 um 10:52 schrieb Thilina Madhusanka :
> 
> Hi
> 
> Is there a way to access jenkins env variables via a plugin ?
> 
> take input like ${BUILD_NUMBER}  to a plugin via test input box?
> 
> thanks
> 
> --
> 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 jenkinsci-dev+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/535f94c2-85c1-46b3-9cf4-6a7054a05146%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/59DBFC2F-DD2A-4D89-B0C4-69DCD4ABD854%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Access Environment variables

2015-10-29 Thread Thilina Madhusanka
Hi

Is there a way to access jenkins env variables via a plugin ? 

take input like ${BUILD_NUMBER}  to a plugin via test input box? 

thanks

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/535f94c2-85c1-46b3-9cf4-6a7054a05146%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access Environment variables

2015-10-29 Thread Thilina Madhusanka
Hi

thanks for the reply 

this  is what i need to do. 

i need to save a report that generate from a plugin with user given env 
variable append to report file name. 

user need to input file name any string but when user input string with env 
variable  

for example id user enter report name as reportname-${BUILD_NUMBER} 
is there a way to directly convert this env variable in to the value? 

or i have to check it and then call get method to get value for that env 
variable and append it to report name? 

thanks
 
On Thursday, October 29, 2015 at 4:14:06 PM UTC+5:30, Ullrich Hafner wrote:
>
> Yes.
>
> You can get the variables e.g. from the current build:
>
> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L2207
>
>
> Am 29.10.2015 um 10:52 schrieb Thilina Madhusanka  >:
>
> Hi
>
> Is there a way to access jenkins env variables via a plugin ? 
>
> take input like ${BUILD_NUMBER}  to a plugin via test input box? 
>
> thanks
>
> -- 
> 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 jenkinsci-de...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/535f94c2-85c1-46b3-9cf4-6a7054a05146%40googlegroups.com
>  
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/2bc65ecf-ebc0-4656-b1cf-2940f65d0d5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Access Environment variables

2015-10-29 Thread Ullrich Hafner
See 
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Util.java#L139
 


> Am 29.10.2015 um 11:53 schrieb Thilina Madhusanka :
> 
> Hi
> 
> thanks for the reply
> 
> this  is what i need to do.
> 
> i need to save a report that generate from a plugin with user given env 
> variable append to report file name.
> 
> user need to input file name any string but when user input string with env 
> variable
> 
> for example id user enter report name as reportname-${BUILD_NUMBER}
> is there a way to directly convert this env variable in to the value?
> 
> or i have to check it and then call get method to get value for that env 
> variable and append it to report name?
> 
> thanks
> 
> On Thursday, October 29, 2015 at 4:14:06 PM UTC+5:30, Ullrich Hafner wrote:
> Yes.
> 
> You can get the variables e.g. from the current build:
> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L2207
>  
> 
> 
> 
>> Am 29.10.2015 um 10:52 schrieb Thilina Madhusanka > >:
>> 
>> Hi
>> 
>> Is there a way to access jenkins env variables via a plugin ?
>> 
>> take input like ${BUILD_NUMBER}  to a plugin via test input box?
>> 
>> thanks
>> 
>> --
>> 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 jenkinsci-de...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/535f94c2-85c1-46b3-9cf4-6a7054a05146%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> 
> --
> 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 jenkinsci-dev+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/2bc65ecf-ebc0-4656-b1cf-2940f65d0d5f%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/D41EFD48-2C04-4FF2-BFB9-D507B305787E%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Access Environment variables

2015-10-29 Thread domi
or use the token-macro plugin - it also expands environment variables:
https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin
/Domi


> On 29 Oct 2015, at 11:57, Ullrich Hafner  wrote:
> 
> See 
> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Util.java#L139
>  
> 
> 
>> Am 29.10.2015 um 11:53 schrieb Thilina Madhusanka > >:
>> 
>> Hi
>> 
>> thanks for the reply 
>> 
>> this  is what i need to do. 
>> 
>> i need to save a report that generate from a plugin with user given env 
>> variable append to report file name. 
>> 
>> user need to input file name any string but when user input string with env 
>> variable  
>> 
>> for example id user enter report name as reportname-${BUILD_NUMBER} 
>> is there a way to directly convert this env variable in to the value? 
>> 
>> or i have to check it and then call get method to get value for that env 
>> variable and append it to report name? 
>> 
>> thanks
>>  
>> On Thursday, October 29, 2015 at 4:14:06 PM UTC+5:30, Ullrich Hafner wrote:
>> Yes.
>> 
>> You can get the variables e.g. from the current build:
>> https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Run.java#L2207
>>  
>> 
>> 
>> 
>>> Am 29.10.2015 um 10:52 schrieb Thilina Madhusanka >> >:
>>> 
>>> Hi
>>> 
>>> Is there a way to access jenkins env variables via a plugin ? 
>>> 
>>> take input like ${BUILD_NUMBER}  to a plugin via test input box? 
>>> 
>>> thanks
>>> 
>>> -- 
>>> 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 jenkinsci-de...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/535f94c2-85c1-46b3-9cf4-6a7054a05146%40googlegroups.com
>>>  
>>> .
>>> For more options, visit https://groups.google.com/d/optout 
>>> .
>> 
>> 
>> -- 
>> 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 jenkinsci-dev+unsubscr...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/2bc65ecf-ebc0-4656-b1cf-2940f65d0d5f%40googlegroups.com
>>  
>> .
>> For more options, visit https://groups.google.com/d/optout 
>> .
> 
> 
> -- 
> 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 jenkinsci-dev+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/D41EFD48-2C04-4FF2-BFB9-D507B305787E%40gmail.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/75EB133F-1744-410D-A471-8F887AA2C382%40fortysix.ch.
For more options, visit https://groups.google.com/d/optout.