New subscriber here...

I have searched through the archives looking for an answer but haven't yet 
been able to find a solution to my problem (even though it appears this 
question has been asked before)

I have specific build output that I need to load into my email-ext script 
(a specially formatted version string) so I have the following code in the 
start of my groovy script which works fine if everything is executed from 
the master but fails otherwise

<% def versionString = ""
fr = new FileReader(build.workspace.toString() + "\\Build\\version.txt")
if (fr != null) {
versionString = fr.readLine()
} %>

Produces the following error:
        Exception: javax.script.ScriptException: 
java.io.FileNotFoundException: 
c:\jenkins\workspace\project_name\Build\version.txt (No such file or 
directory)

So aside from the obvious need for a try/catch block does anyone have 
a recommendation for loading a file from a slave?
Regards,
Bryan H.

P.S. Is there a way to change the MimeMessage.subject from inside the 
groovy body script (or do I have to ask my administrator to kindly update 
the plugin to a version > 2.22)?

Reply via email to