Package io.quarkus.deployment.builditem
Class InitTaskBuildItem
- java.lang.Object
-
- io.quarkus.builder.item.BuildItem
-
- io.quarkus.builder.item.MultiBuildItem
-
- io.quarkus.deployment.builditem.InitTaskBuildItem
-
public final class InitTaskBuildItem extends MultiBuildItem
Represents an initalization task for the application. Often extension perform some sort of initialization as part of the application startup. There are cases where we we want to externalize the initialization (e.g. in a pipeline). Often the task is run using the same artifact as the application but using a different command or arguments. In the later case it might be deseriable to pass additional environment variable to both the init tasks (to enable init) and the application (to disable the init).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InitTaskBuildItem
create()
Map<String,String>
getAppEnvVars()
List<String>
getArguments()
List<String>
getCommand()
Optional<String>
getImage()
String
getName()
Map<String,String>
getTaskEnvVars()
boolean
isSharedEnvironment()
Flag for tasks that require access to the environment variables of the application.boolean
isSharedFilesystem()
Flag for tasks that need to share filesystem with the application.InitTaskBuildItem
withAppEnvVars(Map<String,String> appEnvVars)
InitTaskBuildItem
withArguments(List<String> arguments)
InitTaskBuildItem
withCommand(List<String> command)
InitTaskBuildItem
withImage(String image)
InitTaskBuildItem
withName(String name)
InitTaskBuildItem
withSharedEnvironment(boolean sharedEnvironment)
InitTaskBuildItem
withSharedFilesystem(boolean sharedFilesystem)
InitTaskBuildItem
withTaskEnvVars(Map<String,String> taskEnvVars)
-
-
-
Method Detail
-
create
public static InitTaskBuildItem create()
-
getName
public String getName()
-
withName
public InitTaskBuildItem withName(String name)
-
withImage
public InitTaskBuildItem withImage(String image)
-
withCommand
public InitTaskBuildItem withCommand(List<String> command)
-
withArguments
public InitTaskBuildItem withArguments(List<String> arguments)
-
withTaskEnvVars
public InitTaskBuildItem withTaskEnvVars(Map<String,String> taskEnvVars)
-
withAppEnvVars
public InitTaskBuildItem withAppEnvVars(Map<String,String> appEnvVars)
-
isSharedEnvironment
public boolean isSharedEnvironment()
Flag for tasks that require access to the environment variables of the application. Often tasks need to access resources, configured via environment variables. This flag expresses that the task should be executed using the same envrironment variables as the application.- Returns:
- true when the task is meant to share environment variables with the application.
-
withSharedEnvironment
public InitTaskBuildItem withSharedEnvironment(boolean sharedEnvironment)
-
isSharedFilesystem
public boolean isSharedFilesystem()
Flag for tasks that need to share filesystem with the application. Often tasks need to access resources, configured via filesystem (e.g. local config files, kubernetes service binding etc). In other cases, tasks may need to produce files needed by the application. This flag expresses that the task should share filesystem with the application.- Returns:
- true when the task is meant to share filesystem.
-
withSharedFilesystem
public InitTaskBuildItem withSharedFilesystem(boolean sharedFilesystem)
-
-