Bitbucket is getting a new navigation

We’re rolling out these changes, so the documentation may not match your experience in the Bitbucket Cloud app. Read about the new Bitbucket navigation

グローバル オプション

bitbucket-pipelines.ymloptions セクションでは、ステップの最大実行時間や Pipelines Docker コンテナーに割り当てられるリソースなど、リポジトリのすべてのパイプラインに対して、いくつかのグローバル オプションを設定できます。その他のオプションはグローバルに設定できますが、Git クローン オプション、Docker イメージ オプション、キャッシュとサービスのコンテナー オプションなど、bitbucket-pipelines.yml に専用のセクションを保持します。

パイプラインのグローバル オプション

以下のグローバル オプションは、options プロパティで設定されています。

オプション

すべてのパイプラインに適用するグローバル設定を含みます。

プロパティoptions

必須 — いいえ

Data type — Block of new-line separated key-value pairs (YAML spec - Block Mapping)

指定可能な親プロパティ — YAML ルート (options は必ず最上位のプロパティとなります)

Allowed child properties — Requires one or more of the max-time, docker, size, and runtime properties.

例 — options オプションを使用して、パイプラインのグローバル オプションを設定する

options: max-time: 30 docker: true size: 2x pipelines: default: - step: name: Hello world example script: - echo "Hello, World!"

Docker

The global docker option adds a Docker service to all steps in the pipeline. This Docker service can be used to run Docker commands within any pipeline step. For information on using Docker in a Bitbucket Pipeline see Run Docker commands in Bitbucket Pipelines.

プロパティdocker

必須 — いいえ

データ タイプ — ブール値

指定可能な値true または false

既定値false

Allowed parent propertiesoptions

例 — docker を使用して、Docker コマンドをすべてのパイプライン ステップで有効にする

options: docker: true pipelines: default: - step: name: Hello world example script: - docker version - docker run hello-world

例 — services を使用して、単一ステップで Docker コマンドを有効にする

pipelines: default: - step: script: - docker version - docker run hello-world services: - docker

最長時間

max-time オプションは、タイムアウトする前にステップを実行できる最大時間 (分単位) を設定します。max-time オプションは、グローバル options プロパティと個々のパイプライン ステップの両方で設定できます。パイプライン ステップの既定の最大時間は 120 分です。

プロパティmax-time

必須 — いいえ

データ タイプ — 整数

指定可能な値1720 の正の整数

既定値120

Allowed parent propertiesoptions and step

例 — max-time オプションを使用して、パイプラインの各ステップに指定可能な最大時間を設定する

options: max-time: 30 pipelines: default: - step: name: Sleeping step script: - sleep 120m # This step will timeout after 30 minutes

例 — max-time オプションを使用して、パイプラインの個別のステップに指定可能な最大時間を設定する

options: max-time: 60 pipelines: default: - step: name: Sleeping step script: - sleep 120m # This step will timeout after 60 minutes - step: name: quick step max-time: 5 script: - sleep 120m # This step will timeout after 5 minutes

サイズ

size オプションは、Bitbucket Cloud インフラストラクチャまたは Linux Docker セルフホストランナーで実行する場合、ステップまたはパイプライン全体に追加のリソースを割り当てます。

このオプションは、ホストマシン上で利用可能なすべてのリソースを使用する Windows PowerShell、macOS シェル、Linux シェルランナーなどのシェルベースのランナーには影響しません。

デフォルトでは、Bitbucket Cloud インフラストラクチャまたは Linux Docker セルフホスト ランナー上で実行されるステップは、ボリュームをマウントするために、4GB のメモリ、4 つの CPU (他のタスクと共有される場合があります)、step あたり 64 GB のディスク容量にアクセスできます。

2x のサイズを指定すると、step またはパイプラインの空きメモリは 2 倍になります。割り当てられたメモリは stepscriptstep.services の両方で共有されることに注意してください。

4x を超える size オプションを選択すると、追加の CPU リソースとディスク容量も確保されます。step4x 以上の size が割り当てられていると、該当する数の CPU への専用アクセスが保証され、ボリュームをマウントするためのより多くのディスク容量が得られます。

4x ステップは 1x ステップのビルド時間の 4 倍を、2x ステップは 1x ステップのビルド時間の 2 倍を使用します。注意: ビルド時間を増やすと、パイプライン ビルドの現在のコストも増加する可能性があります。

サイズに基づくリソース割り当て

サイズ

CPU

メモリ

ボリューム サイズ

1x

2

4

64 ギガバイト

2x

4

8

64 ギガバイト

4x

8

16

256 ギガバイト

8x

16

32

256 ギガバイト

16x

32

64

256 ギガバイト

24x

48

96

256 ギガバイト

32x

64

128

256 ギガバイト

プロパティsize

必須 — いいえ

データ タイプ — 文字列

指定可能な値 — 次のいずれか:

  • 1x, 2x, 4x, 8x, 16x, 24x or 32x for pipeline steps run on Bitbucket Cloud.

4x, 8x, 16x, 24x, and 32x pipelines size options are only available for builds running on a paid Bitbucket Cloud plan (Standard or Premium).

既定値1x

Allowed parent propertiesoptions and step

例 — size オプションを使用して、すべてのパイプライン ステップで利用可能なメモリを増やす

options: size: 2x pipelines: default: - step: script: - echo "2x memory is probably not needed for an echo command"

例 — size オプションを使用して、パイプライン ステップで利用可能なメモリを増やす

pipelines: default: - step: size: 2x script: - echo "This step gets double the memory!"

ランタイム

ステップに適用されるランタイム設定です。

プロパティruntime

必須 — いいえ

Data type — Block of new-line separated key-value pairs (YAML spec - Block Mapping)

指定可能な親プロパティoptions と step

指定可能な子プロパティcloud (必須)

例 - ランタイムを使用して、4x、8x、および 16x のすべてのステップで atlassian-ip-ranges を、すべてのステップで arm を有効にする

options: runtime: cloud: atlassian-ip-ranges: true arch: arm pipelines: default: - step: size: 4x script: - echo "I use atlassian-ip-ranges"

例 - ランタイムを使用して、特定のステップで atlassian-ip-rangesarm を有効にする

pipelines: default: - step: size: 4x runtime: cloud: atlassian-ip-ranges: true arch: arm script: - echo "I use atlassian-ip-ranges"

 

クラウド ランタイム設定

クラウド ステップに適用されるランタイム設定です。

プロパティcloud

必須 — いいえ

Data type — Block of new-line separated key-value pairs (YAML spec - Block Mapping)

指定可能な親プロパティruntime

指定可能な子プロパティatlassian-ip-ranges (オプション)、arch (オプション)

クラウド ランタイム設定用のアトラシアン IP 範囲

This option indicates whether to use the default aws-ip-ranges or the atlassian-ip-ranges when executing your step for ingress/egress traffic.

プロパティatlassian-ip-ranges

必須 — いいえ

データ タイプ — ブール値

指定可能な値true または false

既定値false

指定可能な親プロパティcloud

クラウド ランタイム設定のアーキテクチャ

このオプションは、ステップを実行するときに使用するアーキテクチャを制御します

プロパティarch

必須 — いいえ

データ タイプ — 文字列

指定可能な値arm または x86

既定値x86

指定可能な親プロパティcloud

arm オプションは、Bitbucket Cloud の Standard または Premium プランで実行されているビルドでのみ利用できます。

エクスポート - Bitbucket Premium のみ

パイプライン定義を同じワークスペース内の他のリポジトリと共有するかどうかを指定します。

プロパティexport

必須 — いいえ

データ タイプ — ブール値

指定可能な値true または false

既定値false

指定可能な親プロパティ — YAML ルート (export は必ず最上位のプロパティとなります)

例 — エクスポート オプションで definitions セクションの pipelines をエクスポートする

export: true definitions: caches: services: pipelines: export-pipeline: - step: script: - echo hello pipelines default: - step: script: - echo hello

Check out the Share Pipelines configuration help document for more information.

 

さらにヘルプが必要ですか?

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