enum LocalCacheMode
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CodeBuild.LocalCacheMode |
Java | software.amazon.awscdk.services.codebuild.LocalCacheMode |
Python | aws_cdk.aws_codebuild.LocalCacheMode |
TypeScript (source) | @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.

.NET
Java
Python
TypeScript (