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 BuildRequest
forJarFile
(File jarFile) Factory method to create a newBuildRequest
from a JAR file.static BuildRequest
forJarFile
(ImageReference name, File jarFile) Factory method to create a newBuildRequest
from a JAR file.getApplicationContent
(Owner owner) Return aTarArchive
containing 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 theCreator
the 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 imagePullPolicy
that the builder should use.Return the run image that should be used, if provided.getTags()
Return the collection of tags that should be created.boolean
Return if caches should be cleaned before packaging.boolean
Return if the built image should be pushed to a registry.boolean
Return if verbose logging output should be used.static BuildRequest
of
(ImageReference name, Function<Owner, TarArchive> applicationContent) Factory method to create a newBuildRequest
with specific content.withBindings
(List<Binding> bindings) Return a newBuildRequest
with updated bindings.withBindings
(Binding... bindings) Return a newBuildRequest
with updated bindings.withBuildCache
(Cache buildCache) Return a newBuildRequest
with an updated build cache.withBuilder
(ImageReference builder) Return a newBuildRequest
with an updated builder.withBuildpacks
(List<BuildpackReference> buildpacks) Return a newBuildRequest
with an updated buildpacks setting.withBuildpacks
(BuildpackReference... buildpacks) Return a newBuildRequest
with an updated buildpacks setting.withCleanCache
(boolean cleanCache) Return a newBuildRequest
with an updated clean cache setting.withCreator
(Creator creator) Return a newBuildRequest
with an updated creator.Return a newBuildRequest
with an additional env variable.Return a newBuildRequest
with additional env variables.withLaunchCache
(Cache launchCache) Return a newBuildRequest
with an updated launch cache.withNetwork
(String network) Return a newBuildRequest
with an updated network setting.withPublish
(boolean publish) Return a newBuildRequest
with an updated publish setting.withPullPolicy
(PullPolicy pullPolicy) Return a newBuildRequest
with the updated image pull policy.withRunImage
(ImageReference runImageName) Return a newBuildRequest
with an updated run image.withTags
(List<ImageReference> tags) Return a newBuildRequest
with updated tags.withTags
(ImageReference... tags) Return a newBuildRequest
with updated tags.withVerboseLogging
(boolean verboseLogging) Return a newBuildRequest
with an updated verbose logging setting.
-
Method Details
-
withBuilder
Return a newBuildRequest
with an updated builder.- Parameters:
builder
- the new builder to use- Returns:
- an updated build request
-
withRunImage
Return a newBuildRequest
with an updated run image.- Parameters:
runImageName
- the run image to use- Returns:
- an updated build request
-
withCreator
Return a newBuildRequest
with an updated creator.- Parameters:
creator
- the newCreator
to use- Returns:
- an updated build request
-
withEnv
Return a newBuildRequest
with an additional env variable.- Parameters:
name
- the variable namevalue
- the variable value- Returns:
- an updated build request
-
withEnv
Return a newBuildRequest
with additional env variables.- Parameters:
env
- the additional variables- Returns:
- an updated build request
-
withCleanCache
Return a newBuildRequest
with an updated clean cache setting.- Parameters:
cleanCache
- if the cache should be cleaned- Returns:
- an updated build request
-
withVerboseLogging
Return a newBuildRequest
with an updated verbose logging setting.- Parameters:
verboseLogging
- if verbose logging should be used- Returns:
- an updated build request
-
withPullPolicy
Return a newBuildRequest
with the updated image pull policy.- Parameters:
pullPolicy
- image pull policyPullPolicy
- Returns:
- an updated build request
-
withPublish
Return a newBuildRequest
with an updated publish setting.- Parameters:
publish
- if the built image should be pushed to a registry- Returns:
- an updated build request
-
withBuildpacks
Return a newBuildRequest
with 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 newBuildRequest
with 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 newBuildRequest
with 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 newBuildRequest
with 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 newBuildRequest
with 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 newBuildRequest
with updated tags.- Parameters:
tags
- a collection of tags to be created for the built image- Returns:
- an updated build request
-
withTags
Return a newBuildRequest
with updated tags.- Parameters:
tags
- a collection of tags to be created for the built image- Returns:
- an updated build request
-
withBuildCache
Return a newBuildRequest
with an updated build cache.- Parameters:
buildCache
- the build cache- Returns:
- an updated build request
-
withLaunchCache
Return a newBuildRequest
with 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 aTarArchive
containing 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 theCreator
the 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 imagePullPolicy
that 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 newBuildRequest
from a JAR file.- Parameters:
jarFile
- the source jar file- Returns:
- a new build request instance
-
forJarFile
Factory method to create a newBuildRequest
from 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 newBuildRequest
with 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
-