Class ScriptTask
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<P>
-
- com.atlassian.bamboo.specs.api.builders.task.Task<ScriptTask,ScriptTaskProperties>
-
- com.atlassian.bamboo.specs.builders.task.ScriptTask
-
public class ScriptTask extends Task<ScriptTask,ScriptTaskProperties>
Represents a task that executes shell script.
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.specs.api.builders.task.Task
conditions, description, requirements, taskEnabled
-
-
Constructor Summary
Constructors Constructor Description ScriptTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScriptTaskargument(@NotNull java.lang.String argument)Sets command line argument to be passed when script is executed.protected @NotNull ScriptTaskPropertiesbuild()ScriptTaskenvironmentVariables(@NotNull java.lang.String environmentVariables)Sets environment variables to be set when script is executed.booleanequals(java.lang.Object o)ScriptTaskfileFromPath(@NotNull java.lang.String path)Sets the file path of script to execute.ScriptTaskfileFromPath(@NotNull java.nio.file.Path path)Sets the file path of script to execute.inthashCode()ScriptTaskinlineBody(@NotNull java.lang.String body)Sets body of the script to execute.ScriptTaskinlineBodyFromPath(@NotNull java.nio.file.Path path)Sets body of the script to execute from a file.ScriptTaskinterpreter(ScriptTaskProperties.Interpreter interpreter)Selects interpreter that will run the script.ScriptTaskinterpreterBinSh()Specifies that script will be run by /bin/sh.ScriptTaskinterpreterCmdExe()Selects that script should be run by cmd.exe.ScriptTaskinterpreterShell()Specifies that script will be run by an interpreter chosen based on the shebang line of the script.ScriptTaskinterpreterWindowsPowerShell()Specifies that script will be run by Windows PowerShell.ScriptTasklocation(ScriptTaskProperties.Location location)Specifies the source of script to run.java.lang.StringtoString()ScriptTaskworkingSubdirectory(@NotNull java.lang.String workingSubdirectory)Sets a directory the script should be executed in.-
Methods inherited from class com.atlassian.bamboo.specs.api.builders.task.Task
conditions, description, enabled, requirements
-
-
-
-
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
-
interpreterShell
public ScriptTask interpreterShell()
Specifies that script will be run by an interpreter chosen based on the shebang line of the script.
-
interpreterWindowsPowerShell
public ScriptTask interpreterWindowsPowerShell()
Specifies that script will be run by Windows PowerShell.
-
interpreterBinSh
public ScriptTask interpreterBinSh()
Specifies that script will be run by /bin/sh.
-
interpreterCmdExe
public ScriptTask interpreterCmdExe()
Selects that script should be run by cmd.exe.
-
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
-
inlineBody
public ScriptTask inlineBody(@NotNull @NotNull java.lang.String body)
Sets body of the script to execute. Only valid whenScriptTaskProperties.Location.INLINEscript location is selected.
-
inlineBodyFromPath
public ScriptTask inlineBodyFromPath(@NotNull @NotNull java.nio.file.Path path)
Sets body of the script to execute from a file. Only valid whenScriptTaskProperties.Location.INLINEscript location is selected.- Parameters:
path- path to the file with the script text
-
fileFromPath
public ScriptTask fileFromPath(@NotNull @NotNull java.nio.file.Path path)
Sets the file path of script to execute. Only valid whenScriptTaskProperties.Location.FILEscript location is selected.
-
fileFromPath
public ScriptTask fileFromPath(@NotNull @NotNull java.lang.String path)
Sets the file path of script to execute. Only valid whenScriptTaskProperties.Location.FILEscript location is selected.
-
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.
-
build
@NotNull protected @NotNull ScriptTaskProperties build()
- Specified by:
buildin classTask<ScriptTask,ScriptTaskProperties>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classTask<ScriptTask,ScriptTaskProperties>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classTask<ScriptTask,ScriptTaskProperties>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classTask<ScriptTask,ScriptTaskProperties>
-
-