Package com.atlassian.bamboo.task
Interface TaskContext
- All Superinterfaces:
CommonTaskContext
,InternalTaskContext
,PluginKeyProvider
,TaskIdentifier
- All Known Implementing Classes:
TaskContextImpl
Encapsulates the environment and configuration of a task running in a building environment.
- Since:
- 3.1
N.B All methods remain on this interface (even though they are on the super class) so we don't accidentally break backwards compatibility.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NotNull BuildContext
Contains all the build related information about the running of the tasks@NotNull BuildLogger
Returns the appropriate logger for the task@NotNull ConfigurationMap
AMap
ofString
values fromTaskDefinition.getConfiguration()
where the values have gone through variable substitution throughCustomVariableContext.substituteString(String)
.@NotNull File
Get build root directory (where sources were checked out)@NotNull File
Get build working directory (where task should be executed).Methods inherited from interface com.atlassian.bamboo.task.CommonTaskContext
doesTaskProduceTestResults, getCommonContext, getRuntimeTaskData
Methods inherited from interface com.atlassian.bamboo.task.TaskIdentifier
getId, getPluginKey, getUserDescription, isEnabled, isFinalising
-
Method Details
-
getBuildContext
Contains all the build related information about the running of the tasks- Returns:
-
getBuildLogger
Returns the appropriate logger for the task- Specified by:
getBuildLogger
in interfaceCommonTaskContext
- Returns:
-
getRootDirectory
Get build root directory (where sources were checked out)- Specified by:
getRootDirectory
in interfaceCommonTaskContext
- Returns:
- Build root directory
-
getWorkingDirectory
Get build working directory (where task should be executed).Default implementation checks for the
TaskConfigConstants.CFG_WORKING_SUBDIRECTORY
key in the TaskConfiguration if such key exists and has not empty value then working directory would be getRootDirectory() + value ofTaskConfigConstants.CFG_WORKING_SUBDIRECTORY
key.- Specified by:
getWorkingDirectory
in interfaceCommonTaskContext
- Returns:
- Build working directory
-
getConfigurationMap
AMap
ofString
values fromTaskDefinition.getConfiguration()
where the values have gone through variable substitution throughCustomVariableContext.substituteString(String)
. All ${bamboo.*} and ${system.*} params are substituted.- Specified by:
getConfigurationMap
in interfaceCommonTaskContext
- Returns:
-
getRuntimeTaskContext
- Specified by:
getRuntimeTaskContext
in interfaceCommonTaskContext
- Returns:
- custom runtime data that complement static task configuration
-