【发布时间】:2012-05-24 21:45:06
【问题描述】:
我想在 Jenkins 作业中运行预构建步骤 shell/perl,并且在某些条件下,我希望它跳过其余的作业,但仍使其成功。有什么办法吗?
感谢您的宝贵时间。
【问题讨论】:
标签: hudson jenkins jenkins-plugins
我想在 Jenkins 作业中运行预构建步骤 shell/perl,并且在某些条件下,我希望它跳过其余的作业,但仍使其成功。有什么办法吗?
感谢您的宝贵时间。
【问题讨论】:
标签: hudson jenkins jenkins-plugins
我使用通过Groovy plugin 运行的系统 Groovy 脚本构建步骤来完成:
def thr = Thread.currentThread()
def thisBuild = thr?.executable
thisBuild.setResult(hudson.model.Result.SUCCESS)
thisBuild.executor.interrupt(hudson.model.Result.SUCCESS)
警告:一些插件(最突出的是运行条件插件)不能优雅地处理“中断构建”(尽管据我所知它们必须这样做)并且如果构建步骤“属于”它们在该代码之后运行,那么构建将失败.
【讨论】:
You attempted to use a method 'hudson' but left out brackets in a place not allowed by the grammar. @ line 18, column 29. thisBuild.setResult(hudson.model.Result.SUCCESS)