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 BuildContextContains all the build related information about the running of the tasks@NotNull BuildLoggerReturns the appropriate logger for the task@NotNull ConfigurationMapAMapofStringvalues fromTaskDefinition.getConfiguration()where the values have gone through variable substitution throughCustomVariableContext.substituteString(String).@NotNull FileGet build root directory (where sources were checked out)@NotNull FileGet build working directory (where task should be executed).Methods inherited from interface com.atlassian.bamboo.task.CommonTaskContext
doesTaskProduceTestResults, getCommonContext, getRuntimeTaskDataMethods 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:
getBuildLoggerin interfaceCommonTaskContext- Returns:
-
getRootDirectory
Get build root directory (where sources were checked out)- Specified by:
getRootDirectoryin interfaceCommonTaskContext- Returns:
- Build root directory
-
getWorkingDirectory
Get build working directory (where task should be executed).Default implementation checks for the
TaskConfigConstants.CFG_WORKING_SUBDIRECTORYkey in the TaskConfiguration if such key exists and has not empty value then working directory would be getRootDirectory() + value ofTaskConfigConstants.CFG_WORKING_SUBDIRECTORYkey.- Specified by:
getWorkingDirectoryin interfaceCommonTaskContext- Returns:
- Build working directory
-
getConfigurationMap
AMapofStringvalues fromTaskDefinition.getConfiguration()where the values have gone through variable substitution throughCustomVariableContext.substituteString(String). All ${bamboo.*} and ${system.*} params are substituted.- Specified by:
getConfigurationMapin interfaceCommonTaskContext- Returns:
-
getRuntimeTaskContext
- Specified by:
getRuntimeTaskContextin interfaceCommonTaskContext- Returns:
- custom runtime data that complement static task configuration
-