我并行运行几个任务,但他们的日志是并行打印的.
这很难理解.
groovy dsl:
parallel (
"stream1": {
node { ... }
},
"stream2": {
node("remote") { ... }
}
)
Run Code Online (Sandbox Code Playgroud)
日志:
[stream1] [workspace] Running shell script 1
[stream2] [workspace] Running shell script 2
[stream2] [workspace] Running shell script 3
[stream1] [workspace] Running shell script 4
Run Code Online (Sandbox Code Playgroud)
我想让这些日志可读.有什么想法如何分开它们?
是否可以(如果可以),如何分别获取每个并行步骤的日志输出?
即:
def projectBranches = [:]
for (int i = 0; i < projects.size(); i++) {
def _i = i
projectBranches[_i] = {
someFunction(_i)
}
}
parallel projectBranches
Run Code Online (Sandbox Code Playgroud)
现在是否可以获取每个projectBranches [_i]的日志?