如何从单个Jenkins Pipeline并行块获取stdout和stderr? [英] How to get stdout and stderr from single Jenkins Pipeline parallel blocks?

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

问题描述

我正在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.

我应该怎么做才能让詹金斯向我展示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并行块获取stdout和stderr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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