🪣

Bitbucket Pipelinesのメモリ上限を引き上げる

2024/04/02に公開

状況

Container 'Build' exceeded memory limit.

Bitbucket Pipelinesでメモリ上限エラーになった。
Container 'Build' exceeded memory limit.
ビルドエラーのようす

bitbucket-pipelines.yml
image: node:20

pipelines:
  pull-requests:
    '**':
        - step:
            name: "Linting: Eslint, Stylelint"

            caches:
              - node
            script:
              - npm ci
              - npm run prepare
              - npm run lint

bitbucket-pipelines.ymlの修正

  • options:ブロックをpipelines:ブロックの前に追加する。これにより、パイプライン全体のデフォルト設定を変更できる。
  • size: 2xオプションを使用することで、ビルドステップに割り当てられるメモリをデフォルトの4GBから8GBに増やすことができる。
bitbucket-pipelines.yml
image: node:20

+ options:
+ size: 2x

pipelines:
  pull-requests:
    '**':
        - step:
            name: "Linting: Eslint, Stylelint"

            caches:
              - node
            script:
              - npm ci
              - npm run prepare
              - npm run lint


ビルド成功のようす

参考

https://support.atlassian.com/bitbucket-cloud/docs/step-options/#Size

Discussion