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 can

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

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

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

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

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

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

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

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

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.

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.

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

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

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

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}

Re: env variables

2012-10-30 Thread Michael Hüttermann
, 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

Re: env variables

2012-10-30 Thread AdvanTiSS
: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

Re: env variables

2012-10-30 Thread lvoty...@redhat.com
You can try to use the class hudson.model.EnvironmentContributor too.