简体   繁体   English

如何获取 Jenkins 多分支项目的项目状态?

[英]How to get the project status of a Jenkins multi-branch project?

It is possible to disable a multi-branch pipeline with:可以通过以下方式禁用多分支管道:

It is possible enable a multi-branch pipeline with:可以通过以下方式启用多分支管道:

But I haven't found any API to get the actual status.但是我还没有找到任何 API 来获得实际状态。

The following URL do not show any difference between a disabled/enabled multi-branch project:以下 URL 未显示禁用/启用多分支项目之间的任何差异:

And the following URL do not show this famous "color" (= status) field for multi-branch project:以下 URL 没有显示多分支项目的这个著名的“颜色”(=状态)字段:

Also, I can have the status of ONE branch, but this status is incorrect: when I disable the multi-branch project, and call this URL:另外,我可以有一个分支的状态,但是这个状态是不正确的:当我禁用多分支项目并调用这个 URL 时:

=> It returns the field "buildable" at true => 它返回字段“可构建”为真

How to retrieve the status we are able to change of the multi-branch project?如何检索我们能够更改的多分支项目的状态?

There seems to be no Jobs API for multi branch pipelines that reports correctly status of the job disabled/enabled.对于正确报告作业禁用/启用状态的多分支管道,似乎没有作业 API。

You can obtain this info from the job's config.xml:您可以从作业的 config.xml 获取此信息:
https://jenkins.domain.com/Multibranch-Job-Name/config.xml https://jenkins.domain.com/Multibranch-Job-Name/config.xml
<disabled>true</disabled>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM