如何关闭git notifyCommit个人Jenkins作业的web钩子触发器? [英] How to turn off git notifyCommit web hook trigger for individual Jenkins jobs?

查看:552
本文介绍了如何关闭git notifyCommit个人Jenkins作业的web钩子触发器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建管道中我有几个Jenkins作业。其中之一是性能测试,需要很长时间才能运行。我希望它每天只运行一次,或者至少在晚上允许的时间窗口运行。



目前,作业被触发:




  • BuildResultTrigger插件


    • 状态:SUCCESS或UNSTABLE

    • 监视管道中的上一个作业
    • 计划:@midnight


  • Git插件 notifyCommit ,通过GitLab服务器中的Web钩子。 / li>


如果仅用于BuildResultTrigger,那么对我来说就足够了。但是, notifyCommit web钩子会触发每个作业使用与URL中定义的相同的git存储库。我不能不使用git仓库,因为显然。 (除非有办法?)



我在找什么:


  • 要么关闭git notifyCommit 个别作业的Web钩子触发器

  • 要么定义时间窗口,例如从00:00 AM到04:00 AM,这是该作业唯一允许运行的时间。


解决方案

我将使用 Clone Workspace SCM插件



这个插件可以从一个项目的构建中归档工作区,并将它们重新用作另一个项目的SCM源。




  • 作业A构建项目

  • 成功构建结束后,Clone Workspace SCM插件将构建工作区

  • 作业B不使用Git SCM,因此它不会被git notifyCommit web钩子触发器激活。 li>
  • 作业B使用Clo ne工作区SCM来检索作业A的最后一个成功构建。

  • 作业B每天运行一次性能测试,计划围绕 @midnight



我还使用共享工作区插件,但我不会再使用它了。克隆工作区更符合我的需求。


I have a couple of Jenkins jobs in a build pipeline. One of them is a performance test and takes a long time to run. I would like it to run only once per day, or at least during a permitted time window at night.

Currently the job gets triggered by:

  • BuildResultTrigger plugin
    • monitors previous job in pipeline (build phase)
    • status: SUCCESS or UNSTABLE
    • schedule: @midnight
  • Git plugin: notifyCommit on push events, by a web hook in the GitLab server.

If it were only for the BuildResultTrigger, then it would be good enough for me. However the notifyCommit web hook triggers every job that uses the same git repository as defined in the URL. And I can't not use the git repository, because obviously. (unless there is a way?)

What I am looking for:

  • Either a way to turn off the git notifyCommit web hook trigger for an individual job.
  • Or a way to define a time window, like from 00:00 AM to 04:00 AM, which is the only time the job is allowed to run.

解决方案

I will use the Clone Workspace SCM plugin.

This plugin makes it possible to archive the workspace from builds of one project and reuse them as the SCM source for another project.

  • Job A builds the project
  • At the end of a successful build, the Clone Workspace SCM plugin archives the build workspace
  • Job B does not use Git SCM, so it won't get activated by the git notifyCommit web hook trigger.
  • Job B uses Clone Workspace SCM to retrieve the last successful build of Job A.
  • Job B runs performance tests once per day, scheduled around @midnight.

I was also using the Shared Workspace plugin, but I will not use that any more. Clone Workspace better fits my needs.

这篇关于如何关闭git notifyCommit个人Jenkins作业的web钩子触发器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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