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 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 theCreatorthe builder should use.getEnv()Return any env variable that should be passed to the builder.Return the platform that should be used when pulling images.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.Return the security options that should be used by the lifecycle.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 whether the builder should be treated as trusted.booleanReturn if verbose logging output should be used.static BuildRequestof(ImageReference name, Function<Owner, TarArchive> applicationContent) Factory method to create a newBuildRequestwith specific content.withApplicationDirectory(String applicationDirectory) Return a newBuildRequestwith an updated application directory.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.withBuildWorkspace(Cache buildWorkspace) Return a newBuildRequestwith an updated build workspace.withCleanCache(boolean cleanCache) Return a newBuildRequestwith an updated clean cache setting.withCreatedDate(String createdDate) Return a newBuildRequestwith an updated created date.withCreator(Creator creator) Return a newBuildRequestwith an updated creator.Return a newBuildRequestwith an additional env variable.Return a newBuildRequestwith additional env variables.withImagePlatform(String platform) Return a newBuildRequestwith an updated image platform.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.withSecurityOptions(List<String> securityOptions) Return a newBuildRequestwith an updated security options.withTags(List<ImageReference> tags) Return a newBuildRequestwith updated tags.withTags(ImageReference... tags) Return a newBuildRequestwith updated tags.withTrustBuilder(boolean trustBuilder) Return a newBuildRequestwith an updated trust builder setting.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
-
withTrustBuilder
Return a newBuildRequestwith an updated trust builder setting.- Parameters:
trustBuilder-trueif the builder should be treated as trusted,falseotherwise- Returns:
- an updated build request
- Since:
- 3.4.0
-
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
-
withBuildWorkspace
Return a newBuildRequestwith an updated build workspace.- Parameters:
buildWorkspace- the build workspace- Returns:
- an updated build request
- Since:
- 3.2.0
-
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
-
withCreatedDate
Return a newBuildRequestwith an updated created date.- Parameters:
createdDate- the created date- Returns:
- an updated build request
-
withApplicationDirectory
Return a newBuildRequestwith an updated application directory.- Parameters:
applicationDirectory- the application directory- Returns:
- an updated build request
-
withSecurityOptions
Return a newBuildRequestwith an updated security options.- Parameters:
securityOptions- the security options- Returns:
- an updated build request
- Since:
- 3.2.0
-
withImagePlatform
Return a newBuildRequestwith an updated image platform.- Parameters:
platform- the image platform- Returns:
- an updated build request
- Since:
- 3.4.0
-
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
-
isTrustBuilder
public boolean isTrustBuilder()Return whether the builder should be treated as trusted.- Returns:
- the trust builder flag
- Since:
- 3.4.0
-
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
-
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
-
getImagePlatform
Return the platform that should be used when pulling images.- Returns:
- the platform or
null - Since:
- 3.4.0
-
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
-