How to Export Bitbucket Pipelines Minutes Usage Report in Bitbucket Cloud

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

要約

Currently, Bitbucket Cloud does not have the functionality to show a report of the minutes used at the pipeline level or repository level. An open feature request is with our development team to include this within the platform. As an alternative, the build statistics pipe can be used to provide this information.

ソリューション

Option 1: Store the pipeline report as a TXT file artifact.  

The file will be created in the BITBUCKET_CLONE_DIR directory. Here is a sample code snippet to configure this:

Here is a sample code snippet to configure this:

pipelines:
  default:
       - step:
           name: "Pipeline Build Statistics" 
           artifacts:
            - build-minutes.txt
           script:
            - pipe: atlassian/bitbucket-build-statistics:1.5.0
              variables:
                BITBUCKET_USERNAME: $BITBUCKET_USERNAME
                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
                FILENAME: "build_usage.txt"
            - ls $BITBUCKET_CLONE_DIR
            - cat build_usage.txt


Option 2: Store the pipeline report as a JSON artifact:

The JSON file can be downloaded, and data can be programmatically processed. Here is a sample code snippet to configure this:

Here is a sample code snippet to configure this:

pipelines:
  default:
       - step:
           name: "Pipeline Build Statistics" 
           artifacts:
            - build-minutes.json
           script:
            - pipe: atlassian/bitbucket-build-statistics:1.5.0
              variables:
                BITBUCKET_USERNAME: $BITBUCKET_USERNAME
                BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
                FILENAME: "build_usage"
                OUTPUT_FILE_FORMAT: "json"
            - ls $BITBUCKET_CLONE_DIR
            - cat build_usage.json

注意

If you are unable to gather the relevant build statistics after following the steps contained within this knowledge article - please feel free to raise a support ticket or raise a community support ticket for further assistance. 

最終更新日: 2024 年 2 月 12 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.