Class InitTaskBuildItem


public final class InitTaskBuildItem extends MultiBuildItem
Represents an initialization task for the application. Often extensions perform some sort of initialization as part of the application startup. There are cases where 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 desirable to pass additional environment variables to both the init tasks (to enable init) and the application (to disable the init).
  • Constructor Details

  • Method Details

    • create

      public static InitTaskBuildItem create()
    • getName

      public String getName()
    • withName

      public InitTaskBuildItem withName(String name)
    • getImage

      public Optional<String> getImage()
    • withImage

      public InitTaskBuildItem withImage(String image)
    • getCommand

      public List<String> getCommand()
    • withCommand

      public InitTaskBuildItem withCommand(List<String> command)
    • getArguments

      public List<String> getArguments()
    • withArguments

      public InitTaskBuildItem withArguments(List<String> arguments)
    • getTaskEnvVars

      public Map<String,String> getTaskEnvVars()
    • withTaskEnvVars

      public InitTaskBuildItem withTaskEnvVars(Map<String,String> taskEnvVars)
    • getAppEnvVars

      public Map<String,String> getAppEnvVars()
    • 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 environment 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 the file system with the application. Often tasks need to access resources, configured via the file system (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 the file system with the application.
      Returns:
      true when the task is meant to share the file system
    • withSharedFilesystem

      public InitTaskBuildItem withSharedFilesystem(boolean sharedFilesystem)