How to read environment variable from a node via jenkins windows batch command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to read environment variable from a node via jenkins windows batch command

gurudatt SA
Hi All,

The code which is executing in the workstation is setting an System variable. And i want to read the system variable from jenkins job - Windows batch command during execution.

Is there a way to do this ?

I have tried the classic way to read the system variable from command line - Echo %MyVariable%, but its not returning anything.

Thanks in advance.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f995bbea-fe21-4b47-a15b-9ae1e3b3f52f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

How to read environment variable from a node via jenkins windows batch command

Victor Martinez
How the agent is connected to the master?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a03e3d8a-37f6-4d4b-9ad8-f9171f704a0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to read environment variable from a node via jenkins windows batch command

Robert Hales
In reply to this post by gurudatt SA
It is hard to answer this without more detail on your jobs. i.e. Is this a freestyle job? How and where is the environment variable set?  Sounds to me like a scope issue. For example, if you are setting the variable in one shell script, then trying to get to it in another, it isn't going to work. 

On Friday, October 6, 2017 at 10:38:12 AM UTC-6, gurudatt SA wrote:
Hi All,

The code which is executing in the workstation is setting an System variable. And i want to read the system variable from jenkins job - Windows batch command during execution.

Is there a way to do this ?

I have tried the classic way to read the system variable from command line - Echo %MyVariable%, but its not returning anything.

Thanks in advance.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/88984561-c4b8-4a36-a2cc-b8ad394415ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.