詹金斯(Jenkins):根据条件发布构建操作 [英] Jenkins: Post build actions on conditions

查看:328
本文介绍了詹金斯(Jenkins):根据条件发布构建操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果控制台日志中存在字符串或正则表达式,我想在Jenkins作业中运行一些后期构建操作.有可用的插件吗?

I want to run some post build actions in my Jenkins job on condition if a string or a regular expression is present in the console log. Any plugin available to do this?

推荐答案

一种解决方案是使用 LogParser 插件,并创建一些正则表达式规则来解析您的日志.

One solution is to use the LogParser plugin and to create some regexp rules to parse your log.

此插件可以将构建状态更改为不稳定:

This plugin can change the build status to Unstable:

接下来,您将创建一个下游作业,您将使用参数化触发器插件将构建状态从上游传递到下游作业.

Next, you create a downstream job and you will use the Parameterized Trigger plugin to pass the build status from the upstream to the downstream job.

如果状态不稳定(= LogParser找到了东西),那么您将执行一些特定的后期构建操作.

If the status is unstable (= the LogParser find something), then you will execute some specific post build actions.

您可以使用有条件的BuildStep 插件进行调整根据上游构建状态进行下游构建步骤.

You can use the Conditional BuildStep plugin to condition the downstream build step according to the upstream build status.

这篇关于詹金斯(Jenkins):根据条件发布构建操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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