Class ScriptTask


  • public class ScriptTask
    extends com.atlassian.bamboo.specs.api.builders.task.Task<ScriptTask,​ScriptTaskProperties>
    Represents a task that executes shell script.
    • Constructor Detail

      • ScriptTask

        public ScriptTask()
    • Method Detail

      • location

        public ScriptTask location​(ScriptTaskProperties.Location location)
        Specifies the source of script to run. Possible options are:
        INLINE
        task runs a script which is stored within this task's configuration
        SCRIPT
        task runs a script form an external file
      • interpreter

        public ScriptTask interpreter​(ScriptTaskProperties.Interpreter interpreter)
        Selects interpreter that will run the script. Possible choices are:
        SHELL
        script will be run by an interpreter chosen based on the shebang line of the script
        WINDOWS_POWER_SHELL
        script will be run by Windows PowerShell
        BINSH_OR_CMDEXE
        script will be run by /bin/sh or cmd.exe, depending on the operating system
      • inlineBodyFromPath

        public ScriptTask inlineBodyFromPath​(@NotNull
                                             @NotNull java.nio.file.Path path)
        Sets body of the script to execute from a file. Only valid when ScriptTaskProperties.Location.INLINE script location is selected.
        Parameters:
        path - path to the file with the script text
      • argument

        public ScriptTask argument​(@NotNull
                                   @NotNull java.lang.String argument)
        Sets command line argument to be passed when script is executed.
      • environmentVariables

        public ScriptTask environmentVariables​(@NotNull
                                               @NotNull java.lang.String environmentVariables)
        Sets environment variables to be set when script is executed.
      • workingSubdirectory

        public ScriptTask workingSubdirectory​(@NotNull
                                              @NotNull java.lang.String workingSubdirectory)
        Sets a directory the script should be executed in.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class com.atlassian.bamboo.specs.api.builders.task.Task<ScriptTask,​ScriptTaskProperties>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class com.atlassian.bamboo.specs.api.builders.task.Task<ScriptTask,​ScriptTaskProperties>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.atlassian.bamboo.specs.api.builders.task.Task<ScriptTask,​ScriptTaskProperties>