Enum LocalCacheMode

java.lang.Object
java.lang.Enum<LocalCacheMode>
software.amazon.awscdk.services.codebuild.LocalCacheMode
All Implemented Interfaces:
Serializable, Comparable<LocalCacheMode>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.827Z") @Stability(Stable) public enum LocalCacheMode extends Enum<LocalCacheMode>
Local cache modes to enable for the CodeBuild Project.

Example:

 Project.Builder.create(this, "Project")
         .source(Source.gitHubEnterprise(GitHubEnterpriseSourceProps.builder()
                 .httpsCloneUrl("https://my-github-enterprise.com/owner/repo")
                 .build()))
         // Enable Docker AND custom caching
         .cache(Cache.local(LocalCacheMode.DOCKER_LAYER, LocalCacheMode.CUSTOM))
         // BuildSpec with a 'cache' section necessary for 'CUSTOM' 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();
 
  • Enum Constant Details

    • SOURCE

      @Stability(Stable) public static final LocalCacheMode SOURCE
      Caches Git metadata for primary and secondary sources.
    • DOCKER_LAYER

      @Stability(Stable) public static final LocalCacheMode DOCKER_LAYER
      Caches existing Docker layers.
    • CUSTOM

      @Stability(Stable) public static final LocalCacheMode CUSTOM
      Caches directories you specify in the buildspec file.
  • Method Details

    • values

      public static LocalCacheMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LocalCacheMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null