相关疑难解决方法(0)

并行任务的日志是无序的

我并行运行几个任务,但他们的日志是并行打印的.
这很难理解.

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)

我想让这些日志可读.有什么想法如何分开它们?

parallel-processing groovy jenkins jenkins-pipeline

6
推荐指数
1
解决办法
2083
查看次数

Jenkins Pipeline-如何从并行构建中获取日志

是否可以(如果可以),如何分别获取每个并行步骤的日志输出?

即:

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]的日志?

continuous-integration jenkins jenkins-pipeline

5
推荐指数
2
解决办法
1394
查看次数