enum LocalCacheMode
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.CodeBuild.LocalCacheMode |
![]() | software.amazon.awscdk.services.codebuild.LocalCacheMode |
![]() | aws_cdk.aws_codebuild.LocalCacheMode |
![]() | @aws-cdk/aws-codebuild » LocalCacheMode |
Local cache modes to enable for the CodeBuild Project.
Example
new codebuild.Project(this, 'Project', {
source: codebuild.Source.gitHubEnterprise({
httpsCloneUrl: 'https://my-github-enterprise.com/owner/repo',
}),
// Enable Docker AND custom caching
cache: codebuild.Cache.local(codebuild.LocalCacheMode.DOCKER_LAYER, codebuild.LocalCacheMode.CUSTOM),
// BuildSpec with a 'cache' section necessary for 'CUSTOM' caching. This can
// also come from 'buildspec.yml' in your source.
buildSpec: codebuild.BuildSpec.fromObject({
version: '0.2',
phases: {
build: {
commands: ['...'],
},
},
cache: {
paths: [
// The '**/*' is required to indicate all files in this directory
'/root/cachedir/**/*',
],
},
}),
});
Members
Name | Description |
---|---|
SOURCE | Caches Git metadata for primary and secondary sources. |
DOCKER_LAYER | Caches existing Docker layers. |
CUSTOM | Caches directories you specify in the buildspec file. |
SOURCE
Caches Git metadata for primary and secondary sources.
DOCKER_LAYER
Caches existing Docker layers.
CUSTOM
Caches directories you specify in the buildspec file.