I would like to do something very simple: create / write to a file located in the remote workspace of the slave via jenkins groovy post- build a script plugin
def props_file = new File(manager.build.workspace.getRemote() + "/temp/module.properties") def build_num = manager.build.buildVariables.get("MODULE_BUILD_NUMBER").toInteger() def build_props = new Properties() build_props["build.number"] = build_num props_file.withOutputStream { p -> build_props.store(p, null) }
The last line failed because the file does not exist. I think this has something to do with the output stream pointing to the master, not the remote workspace, but I'm not sure:
Groovy script failed: java.io.FileNotFoundException: /views/build_view/temp/module.properties (No such file or directory)
I do not write to the file correctly?
source share