グローバル オプション
Bitbucket Pipelines のグローバル パイプライン オプション
The bitbucket-pipelines.yml file configures automated builds, tests, and deployments. Configuration options organize into these top-level sections:
options: Global pipeline settings
clone: Git repository behavior
definitions: Cache and service containers
image: Docker image configuration
pipelines: Pipeline execution flow
parallel: Concurrent step execution
stage: Logical groupings of steps
step: Individual pipeline tasks
options)Contains settings applying to all pipelines in a repository.
Enable Docker command execution across all steps:
options:
docker: true
pipelines:
default:
- step:
script:
- docker version
- docker run hello-worldProperty: docker Data type: Boolean Default: false
Set maximum step runtime (in minutes):
options:
max-time: 30
pipelines:
default:
- step:
name: Sleeping step
script:
- sleep 120m # Timeout after 30 minutesProperty: max-time Data type: Integer Allowed values: 1–720 Default: 120 minutes
Allocate additional resources to steps or pipelines on Bitbucket Cloud or Linux Docker self-hosted runners:
サイズ | CPU | メモリ | Volume |
|---|---|---|---|
1x | 2 | 4GB | 64 ギガバイト |
2x | 4 | 8 GB | 64 ギガバイト |
4x | 8 | 16 GB | 256 ギガバイト |
8x | 16 | 32GB | 256 ギガバイト |
16x | 32 | 64 ギガバイト | 256 ギガバイト |
24 倍 | 48 | 96GB | 256 ギガバイト |
32x | 64 | 128GB | 256 ギガバイト |
options:
size: 2x
pipelines:
default:
- step:
script:
- echo "Double memory allocated"Property: size Default: 1x Note: Larger sizes consume proportionally more build minutes and require Standard/Premium plans.
Configure runtime behavior (architecture, IP ranges):
options:
runtime:
cloud:
atlassian-ip-ranges: true
arch: armProperty: runtime Required child: cloud
Controls how the Git repository is cloned at the start of each step.
Set a shallow clone depth to speed up cloning. The default depth is 50.
clone:
depth: 2Set to full for a complete history (useful for version calculations or changelogs):
clone:
depth: fullEnable or disable Git Large File Storage support:
clone:
lfs: trueDisable cloning entirely when the step does not need the repository source (for example, a pure deployment step):
clone:
enabled: falseプロパティ | 説明 | 既定 |
|---|---|---|
| Shallow clone depth. Use an integer or |
|
| Enable Git LFS |
|
| Whether to clone at all |
|
image: node:18
pipelines:
default:
- step:
name: Build and Test
script:
- npm install
- npm testpipelines:
branches:
main:
- step:
name: Deploy to Production
deployment: production
script:
- ./deploy.sh
develop:
- step:
name: Deploy to Staging
deployment: staging
script:
- ./deploy.sh stagingpipelines:
pull-requests:
'**':
- step:
name: Test PR
script:
- npm testpipelines:
tags:
'v*':
- step:
name: Release
script:
- ./release.shpipelines:
custom:
deploy-to-staging:
- step:
name: Manual Deploy
deployment: staging
script:
- ./deploy.shRun multiple steps simultaneously:
pipelines:
default:
- parallel:
- step:
name: Unit Tests
script:
- npm run test:unit
- step:
name: Integration Tests
script:
- npm run test:integration
- step:
name: Lint
script:
- npm run lintGroup steps for organized execution:
pipelines:
default:
- stage:
name: Build
steps:
- step:
name: Compile
script:
- npm run build
- stage:
name: Test
steps:
- step:
name: Run Tests
script:
- npm test
- stage:
name: Deploy
deployment: production
steps:
- step:
name: Deploy
script:
- ./deploy.sh- step:
name: Build Application
image: node:18
caches:
- node
services:
- redis
artifacts:
- dist/**
script:
- npm install
- npm run build- step:
name: Deploy
condition:
changesets:
includePaths:
- "src/**"
script:
- ./deploy.shDefine reusable resources:
definitions:
caches:
npm: ~/.npm
cypress: ~/.cache/Cypress
services:
redis:
image: redis:7
postgres:
image: postgres:15
variables:
POSTGRES_DB: testdb
POSTGRES_USER: testuser
POSTGRES_PASSWORD: $DB_PASSWORDimage: node:18
definitions:
caches:
npm: ~/.npm
services:
postgres:
image: postgres:15
variables:
POSTGRES_DB: myapp
POSTGRES_PASSWORD: $DB_PASSWORD
options:
max-time: 60
size: 2x
pipelines:
default:
- step:
name: Build and Test
caches:
- node
- npm
services:
- postgres
script:
- npm install
- npm run build
- npm test
artifacts:
- dist/**
branches:
main:
- step:
name: Build
caches:
- node
script:
- npm install
- npm run build
artifacts:
- dist/**
- step:
name: Deploy to Production
deployment: production
script:
- ./deploy.sh production
pull-requests:
'**':
- step:
name: PR Tests
caches:
- node
script:
- npm install
- npm test
- npm run lintPipeline: Top-level trigger definitions (default, branches, tags)
Step: Individual executable tasks with scripts and configuration
Parallel: Execute multiple steps simultaneously
Stage: Group steps for organized execution flow
Definitions: Reusable service and cache configurations
Configure Docker Images for your build environment
Set up Variables and Secrets
Add Caching to improve performance
Use Service Containers for testing
グローバル オプション
Bitbucket Pipelines のグローバル パイプライン オプション
Git クローンの動作
Bitbucket Pipelines の Git クローンの動作を制御するためのオプション
Cache, service container, step config, and export pipelines definitions
データベース サービスなど、依存関係キャッシュとサービス コンテナーを作成します
Docker イメージ オプション
Bitbucket Pipelines でカスタム Docker イメージを使用する
パイプラインの開始条件
Bitbucket Pipelines を実行するための開始条件またはトリガーを設定します
並行ステップ オプション
複数のパイプライン ステップを同時に実行します
子パイプライン ステップのオプション
子パイプラインを使用して、パイプライン内で別のパイプラインをトリガーするステップを定義します。
Custom configuration files
Custom config files let you specify an alternate YAML file for a pipeline run, enabling multiple pipeline definitions in a single repository.
Runtime v3 を有効にして使用する
Docker サービスでランタイム v3 を有効にして使用します。
ステージ オプション
ステップをステージとしてグループ化するか、複数のステップから成るデプロイ ステージを作成します
ステップ オプション
パイプライン ステップを定義してカスタマイズします
この内容はお役に立ちましたか?