类 BuildRequest

java.lang.Object
cn.taketoday.buildpack.platform.build.BuildRequest

public class BuildRequest extends Object
A build request to be handled by the Builder.
从以下版本开始:
4.0
作者:
Phillip Webb, Scott Frederick, Andrey Shlykov, Jeroen Meijer, Rafael Ceccone, Julian Liebig, Harry Yang
  • 字段详细资料

    • DEFAULT_BUILDER_IMAGE_NAME

      static final String DEFAULT_BUILDER_IMAGE_NAME
      另请参阅:
    • DEFAULT_BUILDER

      private static final ImageReference DEFAULT_BUILDER
    • name

      private final ImageReference name
    • applicationContent

      private final Function<Owner,TarArchive> applicationContent
    • builder

      private final ImageReference builder
    • runImage

      private final ImageReference runImage
    • creator

      private final Creator creator
    • env

      private final Map<String,String> env
    • cleanCache

      private final boolean cleanCache
    • verboseLogging

      private final boolean verboseLogging
    • pullPolicy

      private final PullPolicy pullPolicy
    • publish

      private final boolean publish
    • buildpacks

      private final List<BuildpackReference> buildpacks
    • bindings

      private final List<Binding> bindings
    • network

      private final String network
    • tags

      private final List<ImageReference> tags
    • buildWorkspace

      private final Cache buildWorkspace
    • buildCache

      private final Cache buildCache
    • launchCache

      private final Cache launchCache
    • createdDate

      private final Instant createdDate
    • applicationDirectory

      private final String applicationDirectory
    • securityOptions

      private final List<String> securityOptions
  • 构造器详细资料

  • 方法详细资料

    • withBuilder

      public BuildRequest withBuilder(ImageReference builder)
      Return a new BuildRequest with an updated builder.
      参数:
      builder - the new builder to use
      返回:
      an updated build request
    • withRunImage

      public BuildRequest withRunImage(ImageReference runImageName)
      Return a new BuildRequest with an updated run image.
      参数:
      runImageName - the run image to use
      返回:
      an updated build request
    • withCreator

      public BuildRequest withCreator(Creator creator)
      Return a new BuildRequest with an updated creator.
      参数:
      creator - the new Creator to use
      返回:
      an updated build request
    • withEnv

      public BuildRequest withEnv(String name, String value)
      Return a new BuildRequest with an additional env variable.
      参数:
      name - the variable name
      value - the variable value
      返回:
      an updated build request
    • withEnv

      public BuildRequest withEnv(Map<String,String> env)
      Return a new BuildRequest with additional env variables.
      参数:
      env - the additional variables
      返回:
      an updated build request
    • withCleanCache

      public BuildRequest withCleanCache(boolean cleanCache)
      Return a new BuildRequest with an updated clean cache setting.
      参数:
      cleanCache - if the cache should be cleaned
      返回:
      an updated build request
    • withVerboseLogging

      public BuildRequest withVerboseLogging(boolean verboseLogging)
      Return a new BuildRequest with an updated verbose logging setting.
      参数:
      verboseLogging - if verbose logging should be used
      返回:
      an updated build request
    • withPullPolicy

      public BuildRequest withPullPolicy(PullPolicy pullPolicy)
      Return a new BuildRequest with the updated image pull policy.
      参数:
      pullPolicy - image pull policy PullPolicy
      返回:
      an updated build request
    • withPublish

      public BuildRequest withPublish(boolean publish)
      Return a new BuildRequest with an updated publish setting.
      参数:
      publish - if the built image should be pushed to a registry
      返回:
      an updated build request
    • withBuildpacks

      public BuildRequest withBuildpacks(BuildpackReference... buildpacks)
      Return a new BuildRequest with an updated buildpacks setting.
      参数:
      buildpacks - a collection of buildpacks to use when building the image
      返回:
      an updated build request
    • withBuildpacks

      public BuildRequest withBuildpacks(List<BuildpackReference> buildpacks)
      Return a new BuildRequest with an updated buildpacks setting.
      参数:
      buildpacks - a collection of buildpacks to use when building the image
      返回:
      an updated build request
    • withBindings

      public BuildRequest withBindings(Binding... bindings)
      Return a new BuildRequest with updated bindings.
      参数:
      bindings - a collection of bindings to mount to the build container
      返回:
      an updated build request
    • withBindings

      public BuildRequest withBindings(List<Binding> bindings)
      Return a new BuildRequest with updated bindings.
      参数:
      bindings - a collection of bindings to mount to the build container
      返回:
      an updated build request
    • withNetwork

      public BuildRequest withNetwork(String network)
      Return a new BuildRequest with an updated network setting.
      参数:
      network - the network the build container will connect to
      返回:
      an updated build request
    • withTags

      public BuildRequest withTags(ImageReference... tags)
      Return a new BuildRequest with updated tags.
      参数:
      tags - a collection of tags to be created for the built image
      返回:
      an updated build request
    • withTags

      public BuildRequest withTags(List<ImageReference> tags)
      Return a new BuildRequest with updated tags.
      参数:
      tags - a collection of tags to be created for the built image
      返回:
      an updated build request
    • withBuildWorkspace

      public BuildRequest withBuildWorkspace(Cache buildWorkspace)
      Return a new BuildRequest with an updated build workspace.
      参数:
      buildWorkspace - the build workspace
      返回:
      an updated build request
    • withBuildCache

      public BuildRequest withBuildCache(Cache buildCache)
      Return a new BuildRequest with an updated build cache.
      参数:
      buildCache - the build cache
      返回:
      an updated build request
    • withLaunchCache

      public BuildRequest withLaunchCache(Cache launchCache)
      Return a new BuildRequest with an updated launch cache.
      参数:
      launchCache - the cache
      返回:
      an updated build request
    • withCreatedDate

      public BuildRequest withCreatedDate(String createdDate)
      Return a new BuildRequest with an updated created date.
      参数:
      createdDate - the created date
      返回:
      an updated build request
    • parseCreatedDate

      private Instant parseCreatedDate(String createdDate)
    • withApplicationDirectory

      public BuildRequest withApplicationDirectory(String applicationDirectory)
      Return a new BuildRequest with an updated application directory.
      参数:
      applicationDirectory - the application directory
      返回:
      an updated build request
    • withSecurityOptions

      public BuildRequest withSecurityOptions(List<String> securityOptions)
      Return a new BuildRequest with an updated security options.
      参数:
      securityOptions - the security options
      返回:
      an updated build request
    • getName

      public ImageReference getName()
      Return the name of the image that should be created.
      返回:
      the name of the image
    • getApplicationContent

      public TarArchive getApplicationContent(Owner owner)
      Return a TarArchive containing the application content that the buildpack should package. This is typically the contents of the Jar.
      参数:
      owner - the owner of the tar entries
      返回:
      the application content
      另请参阅:
    • getBuilder

      public ImageReference getBuilder()
      Return the builder that should be used.
      返回:
      the builder to use
    • getRunImage

      public ImageReference getRunImage()
      Return the run image that should be used, if provided.
      返回:
      the run image
    • getCreator

      public Creator getCreator()
      Return the Creator the builder should use.
      返回:
      the Creator
    • getEnv

      public Map<String,String> getEnv()
      Return any env variable that should be passed to the builder.
      返回:
      the builder env
    • isCleanCache

      public boolean isCleanCache()
      Return if caches should be cleaned before packaging.
      返回:
      if caches should be cleaned
    • isVerboseLogging

      public boolean isVerboseLogging()
      Return if verbose logging output should be used.
      返回:
      if verbose logging should be used
    • isPublish

      public boolean isPublish()
      Return if the built image should be pushed to a registry.
      返回:
      if the built image should be pushed to a registry
    • getPullPolicy

      public PullPolicy getPullPolicy()
      Return the image PullPolicy that the builder should use.
      返回:
      image pull policy
    • getBuildpacks

      public List<BuildpackReference> getBuildpacks()
      Return the collection of buildpacks to use when building the image, if provided.
      返回:
      the buildpacks
    • getBindings

      public List<Binding> getBindings()
      Return the collection of bindings to mount to the build container.
      返回:
      the bindings
    • getNetwork

      public String getNetwork()
      Return the network the build container will connect to.
      返回:
      the network
    • getTags

      public List<ImageReference> getTags()
      Return the collection of tags that should be created.
      返回:
      the tags
    • getBuildWorkspace

      public Cache getBuildWorkspace()
    • getBuildCache

      public Cache getBuildCache()
      Return the custom build cache that should be used by the lifecycle.
      返回:
      the build cache
    • getLaunchCache

      public Cache getLaunchCache()
      Return the custom launch cache that should be used by the lifecycle.
      返回:
      the launch cache
    • getCreatedDate

      public Instant getCreatedDate()
      Return the custom created date that should be used by the lifecycle.
      返回:
      the created date
    • getApplicationDirectory

      public String getApplicationDirectory()
      Return the application directory that should be used by the lifecycle.
      返回:
      the application directory
    • getSecurityOptions

      public List<String> getSecurityOptions()
      Return the security options that should be used by the lifecycle.
      返回:
      the security options
    • forJarFile

      public static BuildRequest forJarFile(File jarFile)
      Factory method to create a new BuildRequest from a JAR file.
      参数:
      jarFile - the source jar file
      返回:
      a new build request instance
    • forJarFile

      public static BuildRequest forJarFile(ImageReference name, File jarFile)
      Factory method to create a new BuildRequest from a JAR file.
      参数:
      name - the name of the image that should be created
      jarFile - the source jar file
      返回:
      a new build request instance
    • of

      public static BuildRequest of(ImageReference name, Function<Owner,TarArchive> applicationContent)
      Factory method to create a new BuildRequest with specific content.
      参数:
      name - the name of the image that should be created
      applicationContent - function to provide the application content
      返回:
      a new build request instance
    • assertJarFile

      private static void assertJarFile(File jarFile)