Hi,
I have a Java plugin (regular step) that is always running on the Master. The setup is also having an additional Node slave. The builds runs on the slave.
The Java step plugin need to gain access to some files within the build's workspace. In order to achieve that, I'm doing the following:
if(build.getWorkspace().isRemote()){
channel = (hudson.remoting.Channel) build.getExecutor().getCurrentWorkspace().getChannel();
hudson.FilePath newFile = new hudson.FilePath(channel, fileOnDiskPath);
}
From here I suppose I can read/write remotely into the salve machine.
This works OK when "build" is AbstractBuild, but it's a puzzle to me how do I get it when 'build' is from type "hudson.model.Run".
I tried build.getExecutor().getCurrentWorkspace() but the Workspace always returns as Null.
Thanks,
Tal.