旧版代码开始了这项工作.没有可用的原因信息 [英] Legacy code started this job. No cause information is available

查看:176
本文介绍了旧版代码开始了这项工作.没有可用的原因信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在jenkins上总是存在一个由"promote build plugin"触发的额外构建,我不知道为什么...

There is always an extra build with triggered by "promote build plugin" on jenkins, which I dont know why...

这是整个管道:

  1. dev将"feature_branch"提交到github
  2. jenkins在"feature_branch"上触发构建以运行所有单元测试

关于构建作业:

  • 如果分支通过了测试,则应转到代码审查"(我在这里使用promote_build_plugin,在代码查看后手动升级),
  • 我使用在其他项目上触发/调用"作为触发部署工作"的操作,仅当它通过代码审查时才能触发.

在部署作业上:
我可以看到触发了一个新的构建,并合并了feature_branch,但是总有另一个构建发生,没有任何更改;旧版代码开始了这项工作.没有可用的原因信息"

on deploy-job:
I can see a new build is triggered and that feature_branch is merged, but there is always another build take place with "no changes; Legacy code started this job. No cause information is available"

我整个下午都在Google上搜索以解决此问题,有帮助吗?

I googled a whole afternoon trying to solve this, any help?

推荐答案

您可能有一个提交后钩子,该钩子通过URL或jenkins-cli触发同一作业

You probably have a post-commit hook that is triggering the same job through a URL or jenkins-cli

在OP注释后

Edit after OP comments:

但是我开始对deploy-job感到疑惑,我没有配置在将更改推送到Github时构建",而是使用在另一个项目升级时构建",因此我认为即使github钩子也被触发了,它不会以额外的构建而告终?

But I start to wonder on the deploy-job, I didnt configure "Build when a change is pushed to Github", instead, I use "Build when another project is promoted", so I think even github hook is triggered, it wont end up with an extra build?

好吧,这是您的问题^^. "触发/调用构建"机制与"升级另一个项目时构建"完全独立.

Well, there is your problem ^^. The "Trigger/Call builds" mechanism is completely separate from the "Build when another project is promoted".

  • 前者允许从构建步骤或升级(与该特定升级相关)触发新的构建.
  • 后者会触发在已配置作业的 any 升级基础上进行的构建.它与"构建其他项目"的后构建配置相反.
  • The former allows to trigger a new build from a buildstep or a promotion (tied to that specific promotion).
  • The latter will trigger a build on any promotion of the configured job. It is the inverse of "Build other projects" post-build configuration.

此外,构建触发器不是 AND'ed ,而是 OR'ed .在触发该的那个时进行构建. 从配置中删除"升级另一个项目时的构建",以消除多余的构建.

Furthermore, build triggers are not AND'ed, they are OR'ed. Build when this or that or that trigger happens. Remove the "Build when another project is promoted" from configuration to git rid of extra builds.

现在,如果要防止SCM提交挂钩触发生成,则需要确保在作业上未配置SCM轮询.另外,不同的SCM插件也有它们自己的选项(我知道SVN SCM插件允许忽略提交后的钩子";不知道git SCM插件)

Now, if you want to prevent builds from being triggered by SCM commit hooks, you need to make sure there is no SCM polling configured on the job. Alternatively different SCM plugins have their own options (I know SVN SCM plugin allows to "ignore post-commit hooks"; don't know about git SCM plugin)

这篇关于旧版代码开始了这项工作.没有可用的原因信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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