@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)",
date="2022-05-20T22:20:01.060Z")
public abstract class Cache
extends software.amazon.jsii.JsiiObject
A cache can store reusable pieces of your build environment and use them across multiple builds.
Example:
Bucket myCachingBucket; Project.Builder.create(this, "Project") .source(Source.bitBucket(BitBucketSourceProps.builder() .owner("awslabs") .repo("aws-cdk") .build())) .cache(Cache.bucket(myCachingBucket)) // BuildSpec with a 'cache' section necessary for S3 caching. This can // also come from 'buildspec.yml' in your source. .buildSpec(BuildSpec.fromObject(Map.of( "version", "0.2", "phases", Map.of( "build", Map.of( "commands", List.of("..."))), "cache", Map.of( "paths", List.of("/root/cachedir/**/*"))))) .build();
https://docs.aws.amazon.com/codebuild/latest/userguide/build-caching.html
Modifier | Constructor and Description |
---|---|
protected |
Cache() |
protected |
Cache(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Cache(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static Cache |
bucket(IBucket bucket)
Create an S3 caching strategy.
|
static Cache |
bucket(IBucket bucket,
BucketCacheOptions options)
Create an S3 caching strategy.
|
static Cache |
local(LocalCacheMode... modes)
Create a local caching strategy.
|
static Cache |
none() |
protected Cache(software.amazon.jsii.JsiiObjectRef objRef)
protected Cache(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected Cache()
public static Cache bucket(IBucket bucket, BucketCacheOptions options)
bucket
- the S3 bucket to use for caching. This parameter is required.options
- additional options to pass to the S3 caching.public static Cache bucket(IBucket bucket)
bucket
- the S3 bucket to use for caching. This parameter is required.public static Cache local(LocalCacheMode... modes)
modes
- the mode(s) to enable for local caching. This parameter is required.public static Cache none()