【问题标题】:Cancel build request in buildbot 1.2.0在 buildbot 1.2.0 中取消构建请求
【发布时间】:2018-06-22 14:46:14
【问题描述】:

为了使用 buildbot 触发不同的操作(启动、检查、停止)并根据事件的状态取消构建请求(基于文件实现 threading.Event 接口),我们使用了 buildbot 的 nextBuild 属性.plugins.util.BuilderConfig (http://docs.buildbot.net/latest/manual/cfg-builders.html):

BuilderConfig(...,
              nextBuild=partial(handle_property_action_for_next_build, event))

因此,根据操作(开始、停止、检查)和事件状态,我们将使用 cancelBuildRequest 取消所有请求:

def handle_property_action_for_next_build(event, _, requests):
    action = requests[0].properties.getProperty("action")

    if action == "start":
        if event.is_set():
            for request in requests:
                request.cancelBuildRequest()
            return None
        else:
            event.set()

但是前段时间取消了cancelBuildRequest方法:https://github.com/buildbot/buildbot/commit/95b90d7f0881dd4891199b16be9af2242729081b#diff-e55fd5266f5206f358b6da23011e41f0

那么问题是如何取消使用 buildbot 1.2.0 的构建请求?

它不需要在 nextBuild 属性中,而是在我有的地方:

  1. 访问当前操作
  2. 可以传递自定义事件
  3. 可以取消构建请求

【问题讨论】:

    标签: python continuous-integration buildbot


    【解决方案1】:

    使用数据接口:

    request.master.data.control("cancel", ("buildrequests", request.id))

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-23
      • 1970-01-01
      • 2021-02-14
      • 1970-01-01
      相关资源
      最近更新 更多