Bill,

There is the NODE_NAME environment variable which gives you the name of the 
node the job is running on, however this just gives you the name of the 
node as defined in Jenkins, this may or may not match to your machine 
hostname especially if you run multiple slaves on the same machine.

If you want the proper hostname of the machine the best way is to run a 
shell/windows script to get it and write it to a properties file, and then 
add this to the environment via the envinject plugin buildstep.


If your intention is to call a slave from a different job on a different 
machine, then there might be better ways of doing this. Such as making it a 
shared resource used by all slaves and using another plugin to control 
access to it.


Chris


On Monday, June 25, 2012 11:47:11 PM UTC+1, BillR wrote:
>
> I want to allocate a slave and have its URL appear as a parameter, 
> e.g. if it were a script, 
>
>     WEBDRIVER_NODE = jenkins.getSlave ubuntu 
>
> so that in my job's mvn cmd: 
>
>     ... -Dremote=$WEBDRIVER_NODE test 
>
> or possibly 
>
>     ... -Dremote=http://${WEBDRIVER_NODE}:4444/wd/hub test 
>
> It seems this must be possible, but I'm not seeing it in the O'Reilly 
> Jenkins book. 
>
> Thanks, 
> Bill 
>
>

Reply via email to