Jenkins中的条件后构建步骤(理想情况下没有插件) [英] Conditional Post-Build step in Jenkins (Ideally without plugins)

查看:1089
本文介绍了Jenkins中的条件后构建步骤(理想情况下没有插件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我正确理解,则可以使用此插件进行构建:(a)带有条件的构建步骤: https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin

If I understand correctly I can make a build step conditional using this plugin: https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin

首先,此插件是否可以执行构建后"步骤? 其次,有没有一种方法可以使无插件的条件限制于构建后步骤?

First does this plugin work the Post-Build steps? Second is there a way to make Post-Build steps conditional without a plugin?

我遇到的情况是,我通过一个通用的Jenkins Job设置支持WebDriver和Selenium IDE测试.如果他们已签入任何一种测试,它将运行它们.然后,我希望它有条件地查看是否显示任何结果文件,如果是,则执行发布结果生成后"步骤,否则跳过该步骤.

The scenario I have is I am supporting both WebDriver and Selenium IDE tests with one universal Jenkins Job setup. If they have checked in either type of test it runs them. I then want it to conditionally look if any results files show up and if so then do the publish results Post-Build step, otherwise skip that step.

目前,如果未显示任何结果,它只是将构建标记为失败,因为未找到测试结果.

Currently if no results show up it simply marks the build as a failure since no test results were found.

任何建议都会有所帮助!

Any suggestions would help!

推荐答案

您可以使任何构建"步骤作为构建后"步骤执行.

You can make any Build step execute as Post-build step.

  • Install Flexible Publish plugin
  • Install Any Build Step plugin
  • Under Configure System, look for "Flexible publish", and choose Any build step from drop-down.

配置作业.

  • 在您的Job配置中,添加名为"Flexible Publish"的构建后操作.
  • 选择条件.
  • 选择操作.

这篇关于Jenkins中的条件后构建步骤(理想情况下没有插件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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