Python 在buildbot 1.2.0中取消生成请求
为了使用buildbot根据事件的状态触发不同的操作(启动、检查、停止)和取消生成请求(基于文件实现threading.event接口),我们使用了buildbot.plugins.util.BuilderConfig()的nextBuild属性: 因此,根据操作(启动、停止、检查)和事件状态,我们将使用cancelBuildRequest取消所有请求:Python 在buildbot 1.2.0中取消生成请求,python,continuous-integration,buildbot,Python,Continuous Integration,Buildbot,为了使用buildbot根据事件的状态触发不同的操作(启动、检查、停止)和取消生成请求(基于文件实现threading.event接口),我们使用了buildbot.plugins.util.BuilderConfig()的nextBuild属性: 因此,根据操作(启动、停止、检查)和事件状态,我们将使用cancelBuildRequest取消所有请求: def handle_property_action_for_next_build(event, _, requests): acti
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方法在一段时间前被删除:
因此,问题是如何使用buildbot 1.2.0取消构建请求
它不需要位于nextBuild属性中,而是位于以下位置:
request.master.data.control(“取消”,
(“buildrequests”,request.id))
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()