groovy Create remote file and append text

10 views
Skip to first unread message

Rui Oliveira

unread,
Oct 31, 2019, 8:01:49 AM10/31/19
to Jenkins Users
Hello all,

I can i create a file with groovy in remote slave machine

if(build.workspace.isRemote())
            {
                channel = build.workspace.channel;
            }

            String fp = new hudson.FilePath(channel, build.workspace.toString() + "/env.properties")
           
            if(fp != null)
            {
                           
                String str = "test";
                fp.append(str); //writing to file
                versionString = fp.readToString(); //reading from file
            }

But append will not work does anybody now how to overcome this?
Reply all
Reply to author
Forward
0 new messages