mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2024-12-13 11:27:08 +02:00
Передача в аллюр относительного пути
This commit is contained in:
parent
ebba596446
commit
c40c9d1f61
@ -36,10 +36,10 @@ class PublishAllure implements Serializable {
|
||||
Logger.println(allurePath.listDirectories().toString())
|
||||
|
||||
allurePath.listDirectories().each { FilePath filePath ->
|
||||
results.add(filePath.getRemote())
|
||||
results.add(FileUtils.getLocalPath(filePath))
|
||||
}
|
||||
if (results.isEmpty()) {
|
||||
results.add(allurePath.getRemote())
|
||||
results.add(FileUtils.getLocalPath(allurePath))
|
||||
}
|
||||
|
||||
Logger.println(results.toString())
|
||||
|
@ -24,4 +24,12 @@ class FileUtils {
|
||||
return new FilePath(Jenkins.getInstanceOrNull().getComputer(nodeName).getChannel(), path);
|
||||
}
|
||||
}
|
||||
|
||||
static String getLocalPath(FilePath filePath) {
|
||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||
|
||||
def env = steps.env();
|
||||
|
||||
return filePath.getRemote().replaceAll("^$env.WORKSPACE/", "").toString()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user