Re: Env variables defined in the StepEnvironmentContributor are globally accessible?

2021-04-14 Thread Victor Martinez
I was doing something wrong and EnvironmentContributor should help with

Sorry for the noise
On Wednesday, 14 April 2021 at 17:29:07 UTC+1 Victor Martinez wrote:

> Hi all,
>
> I'm defining some env variables with the StepEnvironmentContributor but 
> unfortunately I cannot use them with the env.VARIABLE_NAME approach. 
> Although they are accessible when I run an sh step such ash `sh 'echo 
> $VARIABLE_NAME'`
>
> The class with the implementation can be found in 
> https://github.com/jenkinsci/opentelemetry-plugin/blob/master/src/main/java/io/jenkins/plugins/opentelemetry/job/OtelStepEnvironmentContributor.java
>
> Is that the expected behaviour or I'm doing something wrong? 
>
> 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/e49e89f9-7ec2-4972-8a4f-096afec06cafn%40googlegroups.com.


Env variables defined in the StepEnvironmentContributor are globally accessible?

2021-04-14 Thread Victor Martinez
Hi all,

I'm defining some env variables with the StepEnvironmentContributor but 
unfortunately I cannot use them with the env.VARIABLE_NAME approach. 
Although they are accessible when I run an sh step such ash `sh 'echo 
$VARIABLE_NAME'`

The class with the implementation can be found 
in 
https://github.com/jenkinsci/opentelemetry-plugin/blob/master/src/main/java/io/jenkins/plugins/opentelemetry/job/OtelStepEnvironmentContributor.java

Is that the expected behaviour or I'm doing something wrong? 

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/bb37b9be-a351-4867-80a4-552a3261fe8fn%40googlegroups.com.


Re: Parsing user's input that contains Jenkins env variables

2019-10-21 Thread Jesse Glick
On Mon, Oct 21, 2019 at 11:00 AM Slide  wrote:
> Token Macro will also work in pipeline jobs

Perhaps, but I would not recommend it.

https://jenkins.io/doc/developer/plugin-development/pipeline-integration/#variable-substitutions

-- 
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/CANfRfr3aQ-7medmtNuUgzMtJN0zmSHushUfMHo_6Yfovgwnbsw%40mail.gmail.com.


Re: Parsing user's input that contains Jenkins env variables

2019-10-21 Thread Tal Yanai
Thanks Gavin,

On Monday, October 21, 2019 at 6:00:24 PM UTC+3, slide wrote:
>
> Token Macro will also work in pipeline jobs and does provide some 
> additional benefit in that you can have code behind the macro that does 
> some stuff for you that you would have to do manually (and possibly through 
> either @NonCps or shared library). For something simple like a single 
> parameter or environment value, a simple GString in groovy will do the 
> trick. 
>
> On Mon, Oct 21, 2019 at 12:33 AM 'Gavin Mogan' via Jenkins Developers <
> jenkin...@googlegroups.com > wrote:
>
>> For something like a freestyle plugin, I think you need to use the token 
>> macro plugin - https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin
>> for pipeline, groovy will process the string before it gets to your code
>>
>> On Mon, Oct 21, 2019 at 12:30 AM Tal Yanai > > wrote:
>>
>>> Hi,
>>>
>>> Suppose I have made a plugin implementation (a step) that asks the user 
>>> for a location (path) to a file on the disk.
>>>
>>> When the user supply the value (using the job's configuration) he is 
>>> using Jenkins variables/params such as ${JOB_NAME} as part of the path he 
>>> supply.
>>>
>>> So for example, an input can be looked like: 
>>> /home/john/${JOB_NAME}/${BUILD_NUMBER}
>>>
>>> Is there any Java library that know to return back the real value behind 
>>> such input, so that I can farther user the real value within the plugin 
>>> Java code?
>>>
>>> Thanks,
>>>
>>> Tal.
>>>
>>> -- 
>>> 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 jenkin...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/a051d1b6-2ff7-4d93-846d-8bbcd426ef38%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DusaKaQ8863NUecCD%2BZYW_Q4WZsPg148EnwTqPGeM%2B%3DQZw%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> Website: http://earl-of-code.com
>

-- 
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/7bb5816e-8fe6-467c-aa51-0fe8bd39ac0d%40googlegroups.com.


Re: Parsing user's input that contains Jenkins env variables

2019-10-21 Thread Tal Yanai
Thanks a lot, Will try that...

On Monday, October 21, 2019 at 6:00:24 PM UTC+3, slide wrote:
>
> Token Macro will also work in pipeline jobs and does provide some 
> additional benefit in that you can have code behind the macro that does 
> some stuff for you that you would have to do manually (and possibly through 
> either @NonCps or shared library). For something simple like a single 
> parameter or environment value, a simple GString in groovy will do the 
> trick. 
>
> On Mon, Oct 21, 2019 at 12:33 AM 'Gavin Mogan' via Jenkins Developers <
> jenkin...@googlegroups.com > wrote:
>
>> For something like a freestyle plugin, I think you need to use the token 
>> macro plugin - https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin
>> for pipeline, groovy will process the string before it gets to your code
>>
>> On Mon, Oct 21, 2019 at 12:30 AM Tal Yanai > > wrote:
>>
>>> Hi,
>>>
>>> Suppose I have made a plugin implementation (a step) that asks the user 
>>> for a location (path) to a file on the disk.
>>>
>>> When the user supply the value (using the job's configuration) he is 
>>> using Jenkins variables/params such as ${JOB_NAME} as part of the path he 
>>> supply.
>>>
>>> So for example, an input can be looked like: 
>>> /home/john/${JOB_NAME}/${BUILD_NUMBER}
>>>
>>> Is there any Java library that know to return back the real value behind 
>>> such input, so that I can farther user the real value within the plugin 
>>> Java code?
>>>
>>> Thanks,
>>>
>>> Tal.
>>>
>>> -- 
>>> 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 jenkin...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/a051d1b6-2ff7-4d93-846d-8bbcd426ef38%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DusaKaQ8863NUecCD%2BZYW_Q4WZsPg148EnwTqPGeM%2B%3DQZw%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> Website: http://earl-of-code.com
>

-- 
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/4ccbc175-6c8e-4744-a654-a1d3186d54ab%40googlegroups.com.


Re: Parsing user's input that contains Jenkins env variables

2019-10-21 Thread Slide
Token Macro will also work in pipeline jobs and does provide some
additional benefit in that you can have code behind the macro that does
some stuff for you that you would have to do manually (and possibly through
either @NonCps or shared library). For something simple like a single
parameter or environment value, a simple GString in groovy will do the
trick.

On Mon, Oct 21, 2019 at 12:33 AM 'Gavin Mogan' via Jenkins Developers <
jenkinsci-dev@googlegroups.com> wrote:

> For something like a freestyle plugin, I think you need to use the token
> macro plugin - https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin
> for pipeline, groovy will process the string before it gets to your code
>
> On Mon, Oct 21, 2019 at 12:30 AM Tal Yanai  wrote:
>
>> Hi,
>>
>> Suppose I have made a plugin implementation (a step) that asks the user
>> for a location (path) to a file on the disk.
>>
>> When the user supply the value (using the job's configuration) he is
>> using Jenkins variables/params such as ${JOB_NAME} as part of the path he
>> supply.
>>
>> So for example, an input can be looked like:
>> /home/john/${JOB_NAME}/${BUILD_NUMBER}
>>
>> Is there any Java library that know to return back the real value behind
>> such input, so that I can farther user the real value within the plugin
>> Java code?
>>
>> Thanks,
>>
>> Tal.
>>
>> --
>> 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/a051d1b6-2ff7-4d93-846d-8bbcd426ef38%40googlegroups.com
>> 
>> .
>>
> --
> 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/CAG%3D_DusaKaQ8863NUecCD%2BZYW_Q4WZsPg148EnwTqPGeM%2B%3DQZw%40mail.gmail.com
> 
> .
>


-- 
Website: http://earl-of-code.com

-- 
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/CAPiUgVcE5m5c%3DVfzRosBkyxQFykVyR_mEKt4ScqXpT2ecBEopg%40mail.gmail.com.


Re: Parsing user's input that contains Jenkins env variables

2019-10-21 Thread 'Gavin Mogan' via Jenkins Developers
For something like a freestyle plugin, I think you need to use the token
macro plugin - https://wiki.jenkins.io/display/JENKINS/Token+Macro+Plugin
for pipeline, groovy will process the string before it gets to your code

On Mon, Oct 21, 2019 at 12:30 AM Tal Yanai  wrote:

> Hi,
>
> Suppose I have made a plugin implementation (a step) that asks the user
> for a location (path) to a file on the disk.
>
> When the user supply the value (using the job's configuration) he is using
> Jenkins variables/params such as ${JOB_NAME} as part of the path he supply.
>
> So for example, an input can be looked like:
> /home/john/${JOB_NAME}/${BUILD_NUMBER}
>
> Is there any Java library that know to return back the real value behind
> such input, so that I can farther user the real value within the plugin
> Java code?
>
> Thanks,
>
> Tal.
>
> --
> 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/a051d1b6-2ff7-4d93-846d-8bbcd426ef38%40googlegroups.com
> 
> .
>

-- 
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/CAG%3D_DusaKaQ8863NUecCD%2BZYW_Q4WZsPg148EnwTqPGeM%2B%3DQZw%40mail.gmail.com.


Parsing user's input that contains Jenkins env variables

2019-10-21 Thread Tal Yanai
Hi,

Suppose I have made a plugin implementation (a step) that asks the user for 
a location (path) to a file on the disk.

When the user supply the value (using the job's configuration) he is using 
Jenkins variables/params such as ${JOB_NAME} as part of the path he supply.

So for example, an input can be looked like: 
/home/john/${JOB_NAME}/${BUILD_NUMBER}

Is there any Java library that know to return back the real value behind 
such input, so that I can farther user the real value within the plugin 
Java code?

Thanks,

Tal.

-- 
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/a051d1b6-2ff7-4d93-846d-8bbcd426ef38%40googlegroups.com.


Env variables page jelly

2016-06-16 Thread abhishake jha
Hello,

I am new to Plugin development and trying to develop a plugin feature 
relating to environment variables. This feature will basically filter the 
list of environment variables based on some string criteria (helpful when 
we have huge list of env variables).

For that, I am trying to refer to the existing implementation of 
Environment variables config page (ie, Manage Jenkins -- Configure System 
-- Check/uncheck the Environment variables checkbox which displays/hides 
values).
Could you please suggest which file I should be referring to, I'm basically 
trying to look for the Jelly file pertaining to the Env variable feature,
Thank you!

-Abhishake

-- 
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/10bf0921-f509-4e79-ba20-72732604b40e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Accessing Build object or env variables from jelly files

2013-10-22 Thread ulrich igor ngouagna kouete
No body to answer? :(

Le lundi 21 octobre 2013 16:29:55 UTC+2, ulrich igor ngouagna kouete a 
écrit :
>
> Hello,
>
> I'm developping a view for my  jenkins plugin and I need a way to acces 
> the Build object, and the Env vars from my jelly files. 
>
> One of the use cases is I'd like to set some default variable values and I 
> need to acces to the build workspace.
>
> are there any ways of doing these?
>
> Yhank.
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Accessing Build object or env variables from jelly files

2013-10-21 Thread ulrich igor ngouagna kouete
Hello,

I'm developping a view for my  jenkins plugin and I need a way to acces the 
Build object, and the Env vars from my jelly files. 

One of the use cases is I'd like to set some default variable values and I 
need to acces to the build workspace.

are there any ways of doing these?

Yhank.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: env variables

2012-11-08 Thread Christopher Orr

Hi Michael,

Here's how I do it in one of my plugin's Builders:

build.addAction(new EnvironmentContributingAction() {
  public void buildEnvVars(AbstractBuild build, EnvVars envVars) {
if (envVars != null) {
  envVars.put("ANDROID_HOME", sdkRoot);
}
  }

  // Other methods return null...
});

All the other build steps can then use that environment variable.

Regards,
Chris


On 30/10/12 14:10, Michael Hüttermann wrote:

Hello,

could you please give me a pointer what the recommended way is to set
environment variables in hudson.tasks.Builder#perform, which are in turn
read in a later build step inside the same job?


Thank you.


Cheers
Michael





Re: env variables

2012-10-31 Thread Michael Hüttermann
oh, yes, of cause. Thank you!!


> You can try to use the class hudson.model.EnvironmentContributor too.
>



Re: env variables

2012-10-30 Thread lvoty...@redhat.com

You can try to use the class hudson.model.EnvironmentContributor too.


Re: env variables

2012-10-30 Thread AdvanTiSS
*String value = "Hello env vars";
build.addAction(new hudson.model.ParametersAction(new 
hudson.model.StringParameterValue("VAR_NAME", value));*

variable VAR_NAME will be available by next build steps via standard 
variable tag $VAR_NAME

On Tuesday, October 30, 2012 5:44:06 PM UTC+2, Michael Hüttermann wrote:
>
> an environment variable such as WORKSPACE.
> actually it does not matter how to solve the task, which is to pass a 
> variable from the Builder#perform to a different Builder that is executed 
> later as another build step, in the same Jenkins build job.
>
>
> On Tuesday, October 30, 2012 4:30:17 PM UTC+1, HX_unbanned wrote:
>>
>> What kind of env vriables you are reffering to?
>>
>> Nodes ?
>>
>> Slave/Master?
>>
>> System ( User / Machine / System context )?
>>
>> Build env variables, defined with build-scripts?
>>
>> For some part of the fun you can check out my battle against env variable 
>> mess in Jenkins that I find inacceptable in any production software .. 
>>
>>
>> http://stackoverflow.com/questions/12670572/passing-system-env-variable-into-jenkins-slave
>>
>> 2012/10/30 Michael Hüttermann 
>>
>>> thanks, but this solution has the indirection via another plugin. How 
>>> can I directly set environment variables in the Jenkins plugin?
>>>
>>>
>>> Michael
>>>
>>>
>>>
>>>
>>> On Tuesday, October 30, 2012 2:40:06 PM UTC+1, xterm wrote:
>>>>
>>>> Geez, sorry was in a hurry
>>>>
>>>> echo HG_CHANGESET=${HG_CHANGESET} > /tmp/workspace/hgchangeset.**
>>>> properties
>>>>
>>>> where the variable ${HG_CHANGESET} contains the 123:abcdefghi value.
>>>>
>>>> xterm
>>>>
>>>> On Tuesday, October 30, 2012 8:10:38 AM UTC-5, Michael Hüttermann wrote:
>>>>>
>>>>> Hello, 
>>>>>
>>>>> could you please give me a pointer what the recommended way is to set 
>>>>> environment variables in hudson.tasks.Builder#perform, which are in 
>>>>> turn 
>>>>> read in a later build step inside the same job? 
>>>>>
>>>>>
>>>>> Thank you. 
>>>>>
>>>>>
>>>>> Cheers 
>>>>> Michael 
>>>>>
>>>>
>>
>>
>> -- 
>> A.C. Linards L.
>>  
>

Re: env variables

2012-10-30 Thread Michael Hüttermann
an environment variable such as WORKSPACE.
actually it does not matter how to solve the task, which is to pass a 
variable from the Builder#perform to a different Builder that is executed 
later as another build step, in the same Jenkins build job.


On Tuesday, October 30, 2012 4:30:17 PM UTC+1, HX_unbanned wrote:
>
> What kind of env vriables you are reffering to?
>
> Nodes ?
>
> Slave/Master?
>
> System ( User / Machine / System context )?
>
> Build env variables, defined with build-scripts?
>
> For some part of the fun you can check out my battle against env variable 
> mess in Jenkins that I find inacceptable in any production software .. 
>
>
> http://stackoverflow.com/questions/12670572/passing-system-env-variable-into-jenkins-slave
>
> 2012/10/30 Michael Hüttermann >
>
>> thanks, but this solution has the indirection via another plugin. How can 
>> I directly set environment variables in the Jenkins plugin?
>>
>>
>> Michael
>>
>>
>>
>>
>> On Tuesday, October 30, 2012 2:40:06 PM UTC+1, xterm wrote:
>>>
>>> Geez, sorry was in a hurry
>>>
>>> echo HG_CHANGESET=${HG_CHANGESET} > /tmp/workspace/hgchangeset.**
>>> properties
>>>
>>> where the variable ${HG_CHANGESET} contains the 123:abcdefghi value.
>>>
>>> xterm
>>>
>>> On Tuesday, October 30, 2012 8:10:38 AM UTC-5, Michael Hüttermann wrote:
>>>>
>>>> Hello, 
>>>>
>>>> could you please give me a pointer what the recommended way is to set 
>>>> environment variables in hudson.tasks.Builder#perform, which are in 
>>>> turn 
>>>> read in a later build step inside the same job? 
>>>>
>>>>
>>>> Thank you. 
>>>>
>>>>
>>>> Cheers 
>>>> Michael 
>>>>
>>>
>
>
> -- 
> A.C. Linards L.
>  


Re: env variables

2012-10-30 Thread Linards Liepiņš
What kind of env vriables you are reffering to?

Nodes ?

Slave/Master?

System ( User / Machine / System context )?

Build env variables, defined with build-scripts?

For some part of the fun you can check out my battle against env variable
mess in Jenkins that I find inacceptable in any production software ..

http://stackoverflow.com/questions/12670572/passing-system-env-variable-into-jenkins-slave

2012/10/30 Michael Hüttermann 

> thanks, but this solution has the indirection via another plugin. How can
> I directly set environment variables in the Jenkins plugin?
>
>
> Michael
>
>
>
>
> On Tuesday, October 30, 2012 2:40:06 PM UTC+1, xterm wrote:
>>
>> Geez, sorry was in a hurry
>>
>> echo HG_CHANGESET=${HG_CHANGESET} > /tmp/workspace/hgchangeset.**
>> properties
>>
>> where the variable ${HG_CHANGESET} contains the 123:abcdefghi value.
>>
>> xterm
>>
>> On Tuesday, October 30, 2012 8:10:38 AM UTC-5, Michael Hüttermann wrote:
>>>
>>> Hello,
>>>
>>> could you please give me a pointer what the recommended way is to set
>>> environment variables in hudson.tasks.Builder#perform, which are in turn
>>> read in a later build step inside the same job?
>>>
>>>
>>> Thank you.
>>>
>>>
>>> Cheers
>>> Michael
>>>
>>


-- 
A.C. Linards L.


Re: env variables

2012-10-30 Thread Michael Hüttermann
thanks, but this solution has the indirection via another plugin. How can I 
directly set environment variables in the Jenkins plugin?


Michael



On Tuesday, October 30, 2012 2:40:06 PM UTC+1, xterm wrote:
>
> Geez, sorry was in a hurry
>
> echo HG_CHANGESET=${HG_CHANGESET} > /tmp/workspace/hgchangeset.properties
>
> where the variable ${HG_CHANGESET} contains the 123:abcdefghi value.
>
> xterm
>
> On Tuesday, October 30, 2012 8:10:38 AM UTC-5, Michael Hüttermann wrote:
>>
>> Hello, 
>>
>> could you please give me a pointer what the recommended way is to set 
>> environment variables in hudson.tasks.Builder#perform, which are in turn 
>> read in a later build step inside the same job? 
>>
>>
>> Thank you. 
>>
>>
>> Cheers 
>> Michael 
>>
>

Re: env variables

2012-10-30 Thread xterm
Geez, sorry was in a hurry

echo HG_CHANGESET=${HG_CHANGESET} > /tmp/workspace/hgchangeset.properties

where the variable ${HG_CHANGESET} contains the 123:abcdefghi value.

xterm

On Tuesday, October 30, 2012 8:10:38 AM UTC-5, Michael Hüttermann wrote:
>
> Hello, 
>
> could you please give me a pointer what the recommended way is to set 
> environment variables in hudson.tasks.Builder#perform, which are in turn 
> read in a later build step inside the same job? 
>
>
> Thank you. 
>
>
> Cheers 
> Michael 
>


Re: env variables

2012-10-30 Thread xterm
Hey Micheal,

here is how i did it:

i wanted to change my build name to our mercurial change set name, so i did 
this:
1. used the hg command to get the change set name: 123:abcdefghi
2. used a shell to echo the name i wanted to a file like so:
3. echo 123:abcdefghi > /tmp/workspace/changeset.properties
4. in the job configuration inject environment variables section i added 
/tmp/workspace/hgchangeset.properties to the text field and viola

hope that helps

xterm

On Tuesday, October 30, 2012 8:10:38 AM UTC-5, Michael Hüttermann wrote:
>
> Hello, 
>
> could you please give me a pointer what the recommended way is to set 
> environment variables in hudson.tasks.Builder#perform, which are in turn 
> read in a later build step inside the same job? 
>
>
> Thank you. 
>
>
> Cheers 
> Michael 
>


env variables

2012-10-30 Thread Michael Hüttermann
Hello,

could you please give me a pointer what the recommended way is to set
environment variables in hudson.tasks.Builder#perform, which are in turn
read in a later build step inside the same job?


Thank you.


Cheers
Michael