Class Cache
Cache options for CodeBuild Project.
Inheritance
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class Cache : DeputyBase
Syntax (vb)
Public MustInherit Class Cache
Inherits DeputyBase
Remarks
A cache can store reusable pieces of your build environment and use them across multiple builds.
See: https://docs.aws.amazon.com/codebuild/latest/userguide/build-caching.html
ExampleMetadata: infused
Examples
Bucket myCachingBucket;
new Project(this, "Project", new ProjectProps {
Source = Source.BitBucket(new BitBucketSourceProps {
Owner = "awslabs",
Repo = "aws-cdk"
}),
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(new Dictionary<string, object> {
{ "version", "0.2" },
{ "phases", new Dictionary<string, IDictionary<string, string[]>> {
{ "build", new Struct {
Commands = new [] { "..." }
} }
} },
{ "cache", new Dictionary<string, string[]> {
{ "paths", new [] { "/root/cachedir/**/*" } }
} }
})
});
Synopsis
Constructors
Cache() | |
Cache(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Cache(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bucket(IBucket, IBucketCacheOptions) | Create an S3 caching strategy. |
Local(LocalCacheMode[]) | Create a local caching strategy. |
None() |
Constructors
Cache()
protected Cache()
Cache(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Cache(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Cache(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Cache(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bucket(IBucket, IBucketCacheOptions)
Create an S3 caching strategy.
public static Cache Bucket(IBucket bucket, IBucketCacheOptions options = null)
Parameters
- bucket IBucket
the S3 bucket to use for caching.
- options IBucketCacheOptions
additional options to pass to the S3 caching.
Returns
Local(LocalCacheMode[])
Create a local caching strategy.
public static Cache Local(params LocalCacheMode[] modes)
Parameters
- modes LocalCacheMode[]
the mode(s) to enable for local caching.
Returns