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 application directory that should be used by the lifecycle.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 the build workspace that should be used by the lifecycle.Return the custom created date that should be used by the lifecycle.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.Return the security options that should be used by the lifecycle.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.withApplicationDirectory
(String applicationDirectory) Return a newBuildRequest
with an updated application directory.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.withBuildWorkspace
(Cache buildWorkspace) Return a newBuildRequest
with an updated build workspace.withCleanCache
(boolean cleanCache) Return a newBuildRequest
with an updated clean cache setting.withCreatedDate
(String createdDate) Return a newBuildRequest
with an updated created date.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.withSecurityOptions
(List<String> securityOptions) Return a newBuildRequest
with an updated security options.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
-
withBuildWorkspace
Return a newBuildRequest
with an updated build workspace.- Parameters:
buildWorkspace
- the build workspace- Returns:
- an updated build request
- Since:
- 3.2.0
-
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
-
withCreatedDate
Return a newBuildRequest
with an updated created date.- Parameters:
createdDate
- the created date- Returns:
- an updated build request
-
withApplicationDirectory
Return a newBuildRequest
with an updated application directory.- Parameters:
applicationDirectory
- the application directory- Returns:
- an updated build request
-
withSecurityOptions
Return a newBuildRequest
with an updated security options.- Parameters:
securityOptions
- the security options- Returns:
- an updated build request
- Since:
- 3.2.0
-
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
-
getBuildWorkspace
Return the build workspace that should be used by the lifecycle.- Returns:
- the build workspace or
null
- Since:
- 3.2.0
-
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
-
getCreatedDate
Return the custom created date that should be used by the lifecycle.- Returns:
- the created date
-
getApplicationDirectory
Return the application directory that should be used by the lifecycle.- Returns:
- the application directory
-
getSecurityOptions
Return the security options that should be used by the lifecycle.- Returns:
- the security options or
null
- Since:
- 3.2.0
-
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
-