Class BuildRequest
java.lang.Object
org.springframework.boot.buildpack.platform.build.BuildRequest
A build request to be handled by the
Builder.- Since:
- 2.3.0
- Author:
- Phillip Webb, Scott Frederick, Andrey Shlykov, Jeroen Meijer, Rafael Ceccone, Julian Liebig
-
Method Summary
Modifier and TypeMethodDescriptionstatic BuildRequestforJarFile(File jarFile) Factory method to create a newBuildRequestfrom a JAR file.static BuildRequestforJarFile(ImageReference name, File jarFile) Factory method to create a newBuildRequestfrom a JAR file.getApplicationContent(Owner owner) Return aTarArchivecontaining the application content that the buildpack should package.Return the collection of bindings to mount to the build container.Return the custom build cache that should be used by the lifecycle.Return the builder that should be used.Return the collection of buildpacks to use when building the image, if provided.Return theCreatorthe builder should use.getEnv()Return any env variable that should be passed to the builder.Return the custom launch cache that should be used by the lifecycle.getName()Return the name of the image that should be created.Return the network the build container will connect to.Return the imagePullPolicythat the builder should use.Return the run image that should be used, if provided.getTags()Return the collection of tags that should be created.booleanReturn if caches should be cleaned before packaging.booleanReturn if the built image should be pushed to a registry.booleanReturn if verbose logging output should be used.static BuildRequestof(ImageReference name, Function<Owner, TarArchive> applicationContent) Factory method to create a newBuildRequestwith specific content.withBindings(List<Binding> bindings) Return a newBuildRequestwith updated bindings.withBindings(Binding... bindings) Return a newBuildRequestwith updated bindings.withBuildCache(Cache buildCache) Return a newBuildRequestwith an updated build cache.withBuilder(ImageReference builder) Return a newBuildRequestwith an updated builder.withBuildpacks(List<BuildpackReference> buildpacks) Return a newBuildRequestwith an updated buildpacks setting.withBuildpacks(BuildpackReference... buildpacks) Return a newBuildRequestwith an updated buildpacks setting.withCleanCache(boolean cleanCache) Return a newBuildRequestwith an updated clean cache setting.withCreator(Creator creator) Return a newBuildRequestwith an updated creator.Return a newBuildRequestwith an additional env variable.Return a newBuildRequestwith additional env variables.withLaunchCache(Cache launchCache) Return a newBuildRequestwith an updated launch cache.withNetwork(String network) Return a newBuildRequestwith an updated network setting.withPublish(boolean publish) Return a newBuildRequestwith an updated publish setting.withPullPolicy(PullPolicy pullPolicy) Return a newBuildRequestwith the updated image pull policy.withRunImage(ImageReference runImageName) Return a newBuildRequestwith an updated run image.withTags(List<ImageReference> tags) Return a newBuildRequestwith updated tags.withTags(ImageReference... tags) Return a newBuildRequestwith updated tags.withVerboseLogging(boolean verboseLogging) Return a newBuildRequestwith an updated verbose logging setting.
-
Method Details
-
withBuilder
Return a newBuildRequestwith an updated builder.- Parameters:
builder- the new builder to use- Returns:
- an updated build request
-
withRunImage
Return a newBuildRequestwith an updated run image.- Parameters:
runImageName- the run image to use- Returns:
- an updated build request
-
withCreator
Return a newBuildRequestwith an updated creator.- Parameters:
creator- the newCreatorto use- Returns:
- an updated build request
-
withEnv
Return a newBuildRequestwith an additional env variable.- Parameters:
name- the variable namevalue- the variable value- Returns:
- an updated build request
-
withEnv
Return a newBuildRequestwith additional env variables.- Parameters:
env- the additional variables- Returns:
- an updated build request
-
withCleanCache
Return a newBuildRequestwith an updated clean cache setting.- Parameters:
cleanCache- if the cache should be cleaned- Returns:
- an updated build request
-
withVerboseLogging
Return a newBuildRequestwith an updated verbose logging setting.- Parameters:
verboseLogging- if verbose logging should be used- Returns:
- an updated build request
-
withPullPolicy
Return a newBuildRequestwith the updated image pull policy.- Parameters:
pullPolicy- image pull policyPullPolicy- Returns:
- an updated build request
-
withPublish
Return a newBuildRequestwith an updated publish setting.- Parameters:
publish- if the built image should be pushed to a registry- Returns:
- an updated build request
-
withBuildpacks
Return a newBuildRequestwith an updated buildpacks setting.- Parameters:
buildpacks- a collection of buildpacks to use when building the image- Returns:
- an updated build request
- Since:
- 2.5.0
-
withBuildpacks
Return a newBuildRequestwith an updated buildpacks setting.- Parameters:
buildpacks- a collection of buildpacks to use when building the image- Returns:
- an updated build request
- Since:
- 2.5.0
-
withBindings
Return a newBuildRequestwith updated bindings.- Parameters:
bindings- a collection of bindings to mount to the build container- Returns:
- an updated build request
- Since:
- 2.5.0
-
withBindings
Return a newBuildRequestwith updated bindings.- Parameters:
bindings- a collection of bindings to mount to the build container- Returns:
- an updated build request
- Since:
- 2.5.0
-
withNetwork
Return a newBuildRequestwith an updated network setting.- Parameters:
network- the network the build container will connect to- Returns:
- an updated build request
- Since:
- 2.6.0
-
withTags
Return a newBuildRequestwith updated tags.- Parameters:
tags- a collection of tags to be created for the built image- Returns:
- an updated build request
-
withTags
Return a newBuildRequestwith updated tags.- Parameters:
tags- a collection of tags to be created for the built image- Returns:
- an updated build request
-
withBuildCache
Return a newBuildRequestwith an updated build cache.- Parameters:
buildCache- the build cache- Returns:
- an updated build request
-
withLaunchCache
Return a newBuildRequestwith an updated launch cache.- Parameters:
launchCache- the cache- Returns:
- an updated build request
-
getName
Return the name of the image that should be created.- Returns:
- the name of the image
-
getApplicationContent
Return aTarArchivecontaining the application content that the buildpack should package. This is typically the contents of the Jar.- Parameters:
owner- the owner of the tar entries- Returns:
- the application content
- See Also:
-
getBuilder
Return the builder that should be used.- Returns:
- the builder to use
-
getRunImage
Return the run image that should be used, if provided.- Returns:
- the run image
-
getCreator
Return theCreatorthe builder should use.- Returns:
- the
Creator
-
getEnv
Return any env variable that should be passed to the builder.- Returns:
- the builder env
-
isCleanCache
public boolean isCleanCache()Return if caches should be cleaned before packaging.- Returns:
- if caches should be cleaned
-
isVerboseLogging
public boolean isVerboseLogging()Return if verbose logging output should be used.- Returns:
- if verbose logging should be used
-
isPublish
public boolean isPublish()Return if the built image should be pushed to a registry.- Returns:
- if the built image should be pushed to a registry
-
getPullPolicy
Return the imagePullPolicythat the builder should use.- Returns:
- image pull policy
-
getBuildpacks
Return the collection of buildpacks to use when building the image, if provided.- Returns:
- the buildpacks
-
getBindings
Return the collection of bindings to mount to the build container.- Returns:
- the bindings
- Since:
- 2.5.0
-
getNetwork
Return the network the build container will connect to.- Returns:
- the network
- Since:
- 2.6.0
-
getTags
Return the collection of tags that should be created.- Returns:
- the tags
-
getBuildCache
Return the custom build cache that should be used by the lifecycle.- Returns:
- the build cache
-
getLaunchCache
Return the custom launch cache that should be used by the lifecycle.- Returns:
- the launch cache
-
forJarFile
Factory method to create a newBuildRequestfrom a JAR file.- Parameters:
jarFile- the source jar file- Returns:
- a new build request instance
-
forJarFile
Factory method to create a newBuildRequestfrom a JAR file.- Parameters:
name- the name of the image that should be createdjarFile- the source jar file- Returns:
- a new build request instance
-
of
Factory method to create a newBuildRequestwith specific content.- Parameters:
name- the name of the image that should be createdapplicationContent- function to provide the application content- Returns:
- a new build request instance
-