Thanks,

I managed to make it working when both master and slave are running on Windows. 
 However, when Master is on Windows and Slave on Linux, I can't see the files 
being transferred over.

This is my code:

String buildDir = build.getRootDir().getAbsolutePath();
FilePath masterDirectory = new FilePath(new File(buildDir));
launcher.getChannel().call(new vManagerWriteToSlave(content, new 
FilePath(masterDirectory, fileName)));


public class vManagerWriteToSlave extends MasterToSlaveCallable<Void, 
IOException> {
        
        private String message;
        private FilePath outputFile;

        public vManagerWriteToSlave(String message, FilePath outputFile) {
                this.message = message;
                this.outputFile = outputFile;
        }

        @Override
        public Void call() throws IOException {
                SimpleVManagerIO sio = new SimpleVManagerIO();
                sio.writeToFile(message,outputFile.getRemote());
                return null;
        }
} 

-----Original Message-----
From: [email protected] <[email protected]> On Behalf 
Of Jesse Glick
Sent: יום ה 12 נובמבר 2020 20:16
To: Jenkins Dev <[email protected]>
Subject: Re: Writing from Slave To Master

On Wed, Nov 11, 2020 at 11:24 AM Tal Yanai <[email protected]> wrote:
> ReportBuildAction reportAction = new ReportBuildAction(run, 
> summaryReportParams, vAPIConnectionParam, 
> tl,run.getExecutor().getCurrentWorkspace());

Use the `fp` parameter you were given, not `run.executor.currentWorkspace`, and 
just use `FilePath` methods to copy stuff from the agent to the controller.

--
You received this message because you are subscribed to a topic in the Google 
Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/jenkinsci-dev/I0WuyxdA9Nc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1y5F2iM4ogWCuWtwDKR-uGWFh%2BxFw9Hy42drgWsdisCA%40mail.gmail.com.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/003e01d6b939%2475f456b0%2461dd0410%24%40yanai.org.il.

Reply via email to