返回介绍

2.5.15.2. BitbucketServerCoreAPIStatusPush

发布于 2023-09-20 23:50:39 字数 6222 浏览 0 评论 0 收藏 0

Caution

Buildbot no longer supports Python 2.7 on the Buildbot master.

2.5.15.2. BitbucketServerCoreAPIStatusPush

from buildbot.plugins import reporters

ss = reporters.BitbucketServerCoreAPIStatusPush('https://bitbucketserver.example.com:8080/',
                                                auth=('bitbucketserver_username',
                                                      'secret_password'))
c['services'].append(ss)

Or using Bitbucket personal access token

from buildbot.plugins import reporters

ss = reporters.BitbucketServerCoreAPIStatusPush('https://bitbucketserver.example.com:8080/',
                                                token='MDM0MjM5NDc2MDxxxxxxxxxxxxxxxxxxxxx')
c['services'].append(ss)

BitbucketServerCoreAPIStatusPush publishes build status using BitbucketServer Core REST API into which it was integrated in Bitbucket Server 7.4. The build status is published to a specific commit SHA in specific repository in Bitbucket Server with some additional information about reference name, build duration, parent relationship and also possibly test results.

It requires txrequests package to allow interaction with Bitbucket Server REST API.

class BitbucketServerCoreAPIStatusPush(base_url, token=None, auth=None, name=None, statusSuffix=None, generators=None, key=None, parentName=None, buildNumber=None, ref=None, duration=None, testResults=None, verbose=False, debug=None, verify=None)
Parameters:
  • base_url (string) – The base url of the Bitbucket Server host.

  • token (string) – Bitbucket personal access token (mutually exclusive with auth) (can be a Secret)

  • auth (tuple) – A tuple of Bitbucket Server username and password (mutually exclusive with token) (can be a Secret)

  • statusName (renderable string) – The name that is displayed for this status. If not defined it is constructed to look like “%(prop:buildername)s #%(prop:buildnumber)s”. Or if the plan has a parent plan the default is constructed to look like “<parent’s buildername> #<parent’s buildnumber> >> %(prop:buildername)s #%(prop:buildnumber)s”. If build status is generated by BuildRequestGenerator “%(prop:buildername)s #(build request)” is used instead of “%(prop:buildername)s #%(prop:buildnumber)s”. Note: Parent information is not accessible as properties for user defined renderer.

  • statusSuffix (renderable string) – Additional string that is appended to statusName. Empty by default. It is useful when the same plan is launched multiple times for a single parent plan instance. This way every instance of the child plan can have unique suffix and thus be more recognizable (than it would be just by the buildnumber).

  • generators (list of IReportGenerator instances) – A list of report generators that will be used to generate reports to be sent by this reporter. By default build statuses are generated by BuildRequestGenerator and BuildStartEndStatusGenerator.

  • key (renderable string) – Passed to Bitbucket Server to differentiate between statuses. A static string can be passed or Interpolate for dynamic substitution. The default key is %(prop:buildername)s.

  • parentName (renderable string) – Defaults to parent’s buildername if plan has a parent plan. Otherwise plan’s own buildername is used as default.

  • buildNumber (renderable string) – The default build number is %(prop:buildername)s.

  • ref (renderable string) – By default branch name from SourceStamp is used. If branch doesn’t start with string refs/ prefix refs/heads/ is added to it’s beginning.

  • duration (renderable int) – Computed for finished builds. Otherwise None. (value in milliseconds)

  • testResults (renderable dict) – Test results can be reported via this parameter. Resulting dictionary must contain keys failed, skipped, successful. By default these keys are filled with values from build properties (tests_failed, tests_skipped, tests_successful) if at least one of the properties is found (missing values will default to 0). Otherwise None. Note: If you want to suppress the default behavior pass renderable that always interpolates to None.

  • verbose (boolean) – If True, logs a message for each successful status push.

  • verify (boolean) – Disable ssl verification for the case you use temporary self signed certificates.

  • debug (boolean) – Logs every requests and their response.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文