CodeBuild LOCAL_CUSTOM_CACHE not caching

0

For the CodeBuild resource within CloudFormation I have:

      Cache:
        Type: LOCAL
        Modes:
          - LOCAL_CUSTOM_CACHE
          - LOCAL_SOURCE_CACHE

In buildspec.yaml:

version: 0.2

phases:

  install:
    commands:
    - ./install-bazel
    - PATH=$PATH:$HOME/bin

  pre_build:
    commands:
    - mkdir -p .local_cache/bazel/disk
    - mkdir -p .local_cache/bazel/repo
    - ls .local_cache/bazel/disk
    - ls .local_cache/bazel/repo

  build:
    commands:
    - bazel build ... --disk_cache=.local_cache/bazel/disk --repository_cache=.local_cache/bazel/repo
    - bazel test ... --disk_cache=.local_cache/bazel/disk --repository_cache=.local_cache/bazel/repo

  post_build:
    commands:
    - ls .local_cache/bazel/disk
    - ls .local_cache/bazel/repo

artifacts:

  files:
  - '**/*'

cache:

  paths:
  - '.local_cache/**/*'

The ls in the post_build phase shows files in those cached directories. The pre_build phase shows zero files in those cached directories on subsequent builds.

jward
質問済み 5年前444ビュー
2回答
0
承認された回答

I was able to get local caching working by disabling privileged mode in the project.

jward
回答済み 5年前
0

I do have a custom service role on this build, so I'm curious if there is an undocumented IAM permission it needs.

jward
回答済み 5年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ