REPOST: setting path in Buildwrapper setup()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

REPOST: setting path in Buildwrapper setup()

Nikhil Bhoski
Hi ,

I want to set the PATH variable during setup() of BuildWrapper. and use the tools for which i am setting path directly on command line during my build step (Builder class). I am trying to set the env variable using below in setup() method of Build Wrapper

initialEnvironment.put("mytoolRoot", getMytoolRoot + nodeSpecificFileSep + "bin");
initialEnvironment.override("PATH+mytoolRoot",initialEnvironment.get("mytoolRoot") );

and then just to test i am calling my tool through command line directly using Launcher in same setup() method like below 

launcher.launch().cmdAsSingleString("mytool -batch -ver").env(initialEnvironment).stdout(listener).join();

above command fails to pick up the tool directly through the command line. and the build fails with error Cannot run program "mytool" no such file or directory. 

what can i do to set the env variable . the other option i am trying is to write batch and shell script file and execute it. but i am not sure if i should do that. 

Thanks & Regards

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 [hidden email].
To view this discussion on the web visit