I'm facing the same problem
trying to do such things like :
${FILE:${ENV:INSTALL_DIR}/Success.html}
=> the result is : I see that the env variable is resolved but not the file
did a bit of digging, i believe the problem is here
RichTextPublisher.java (line 165)
Matcher matcher = FILE_VAR_PATTERN.matcher(text);
int start = 0;
while (matcher.find(start)) {
String fileName = matcher.group(2); <----- HERE
FilePath filePath = new FilePath(build.getWorkspace(), fileName);
if (filePath.exists()) {
String value = filePath.readToString();
if (matcher.group(1).length() != 4)
{ // Group is file_sl
value = value.replace("\n", "").replace("\r", "");
}
vars.put(String.format("%s:%s", matcher.group(1), fileName), value);
}
start = matcher.end();
}
can we do something like
String fileName = replaceVars(matcher.group(2), vars);
that might do the job, no?
I'm facing the same problem
trying to do such things like :
${FILE:${ENV:INSTALL_DIR}/Success.html}
=> the result is : I see that the env variable is resolved but not the file
did a bit of digging, i believe the problem is here
RichTextPublisher.java (line 165)
Matcher matcher = FILE_VAR_PATTERN.matcher(text);
{ // Group is file_sl value = value.replace("\n", "").replace("\r", ""); }int start = 0;
while (matcher.find(start)) {
String fileName = matcher.group(2); <----- HERE
FilePath filePath = new FilePath(build.getWorkspace(), fileName);
if (filePath.exists()) {
String value = filePath.readToString();
if (matcher.group(1).length() != 4)
vars.put(String.format("%s:%s", matcher.group(1), fileName), value);
}
start = matcher.end();
}
can we do something like
String fileName = replaceVars(matcher.group(2), vars);
that might do the job, no?