如何从单个 Jenkins Pipeline 并行块中获取标准输出和标准错误? [英] How to get stdout and stderr from single Jenkins Pipeline parallel blocks?

查看:32
本文介绍了如何从单个 Jenkins Pipeline 并行块中获取标准输出和标准错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Jenkinsfile 中使用了一个 parallel 块来同时执行一些测试,但是所有的输出都搞混了.

I'm using a parallel block into my Jenkinsfile to execute concurrently some tests, but all the outputs are getting mixed up.

这是我的 Jenkinsfile 的摘录,例如:

This is an extract of my Jenkinsfile, as an example:

// do some IT against different databases
stage name: 'IT'

parallel (
    mysqlIT: {
        node {
            executeMysqlIT()
        }
    },
    oracleIT: {
        node {
            executeOracleIT()
        }
    }
)

请注意,按照此处的建议,我'在每个 parallel 中运行一个新的 node,因此它们得到适当的并行化,并且每个都有自己的工作空间.

Please note that, as suggested here I'm running a new node within each parallel, so they get properly parallelized and each of them gets its own workspace.

我应该怎么做才能让 Jenkins 向我显示 parallel 块的单独输出?

What should I do to have Jenkins show me separated outputs for the parallel blocks?

推荐答案

在您的工作的构建页面上,左侧有一个管道步骤"链接.在树状结构中,您可以找到您的作业已运行的所有步骤,包括并行步骤.您可以进入每个步骤并使用左侧的链接访问其控制台日志.或者,您可以使用同一行右侧的终端"图标.

On the build page of your job there is a link "Pipeline steps" on the left. There in the tree-like structure you can find all the steps that your job has run including parallel ones. You can go inside of every step and access its console log using the link on the left. Alternatively you can use a "terminal" icon on the right in the same row.

单击它,您将看到仅在该步骤中生成的控制台日志,而不会与同时运行的其他步骤混合.如果一个或多个并行步骤仍在进行中,它们的日志将在每个控制台日志页面上动态更新.

Click it and you will see the console log which solely produced within that step without any intermixing with other steps running simultaneously. If a step or several parallel steps are still in progress their logs will be dynamically updated on each of their console log pages.

这篇关于如何从单个 Jenkins Pipeline 并行块中获取标准输出和标准错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆