Sending file content explicitly to a remote agent

10 views
Skip to first unread message

Randall Becker

unread,
Jan 6, 2020, 7:01:36 PM1/6/20
to Jenkins Developers
Hi all,

I am trying to modify a custom Jenkins Plugin to automatically upload a shell script and then execute it to facilitate job execution. Using a separate plugin is not a viable option for reasons I can't really go into here. I'm having difficulty figuring out how to provide a valid stdin in a Controller/Agent structure. Is there a preferred mechanism or example of doing this somewhere? What I am attempting is:

String content = "stuff... ";
ByteArrayInputStream loadContentStream = new ByteArrayInputStream(content.getBytes());
Launcher.ProcStarter starter = launcher.launch();
Launcher.ProcStarter cmdStarter = starter.cmds(usedArgs);
Launcher.ProcStarter outStarter = cmdStarter.stdout(streamBuildListener);
Launcher.ProcStarter inStarter = outStarter.stdin(loadContentStream);

When the shell executes, I'm seeing:
Resource temporarily unavailable

errors on every process I try.


Any suggestions or pointers?

Thanks in advance,
Randall

Randall Becker

unread,
Jan 7, 2020, 2:30:46 PM1/7/20
to Jenkins Developers
Ok, FilePath.act. Got it.
Reply all
Reply to author
Forward
0 new messages