本文介绍了詹金斯管道-阅读上一阶段的日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
考虑一个分为两个阶段的Jenkins管道,分别为阶段A 和阶段B .
Consider a Jenkins Pipeline with two stages, Stage A then Stage B.
在阶段B中,是否可以解析阶段A的某些特定文本的日志?
In Stage B, is it possible to parse the logs of Stage A for some particular text?
推荐答案
自7月28日以来已有更新!
There's been an update since July 28th !
As mentionned in this answer, as of version 2.4 of Pipeline: Nodes and Processes you can use:
def out = sh script: 'command', returnStdout: true
至少比输出到文件然后读取文件更简单,更干净.
At least it's much more simple and clean than outputting to a file and reading the file afterwards.
这篇关于詹金斯管道-阅读上一阶段的日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!