Package com.atlassian.bamboo.task
Class CommonTaskContextImpl
java.lang.Object
com.atlassian.bamboo.task.CommonTaskContextImpl
- All Implemented Interfaces:
PluginKeyProvider
,CommonTaskContext
,InternalTaskContext
,TaskIdentifier
- Direct Known Subclasses:
DeploymentTaskContextImpl
,TaskContextImpl
-
Field Summary
Modifier and TypeFieldDescriptionprotected final TaskRootDirectorySelector
protected final TaskExecutionContext
-
Constructor Summary
ConstructorDescriptionCommonTaskContextImpl
(Map<String, String> substitutedConfiguration, TaskExecutionContext taskExecutionContext, RuntimeTaskDefinition taskDefinition) -
Method Summary
Modifier and TypeMethodDescriptionboolean
@NotNull CommonContext
@NotNull BuildLogger
Returns the appropriate logger for the task@NotNull CommonContext
Contains all the build related information about the running of the tasks@NotNull ConfigurationMap
AMap
ofString
values fromTaskDefinition.getConfiguration()
where the values have gone through variable substitution throughCustomVariableContext.substituteString(String)
.long
getId()
@NotNull String
@NotNull File
Get build root directory (where sources were checked out)@Nullable Map<String,
WhitelistedSerializable> @NotNull File
Get build working directory (where task should be executed).boolean
boolean
-
Field Details
-
rootDirectorySelector
-
taskExecutionContext
-
-
Constructor Details
-
CommonTaskContextImpl
public CommonTaskContextImpl(Map<String, String> substitutedConfiguration, TaskExecutionContext taskExecutionContext, RuntimeTaskDefinition taskDefinition)
-
-
Method Details
-
getId
public long getId()- Specified by:
getId
in interfaceTaskIdentifier
- Returns:
- the id of this configuration. Unique within the given context (e.g.
Job
-
getPluginKey
- Specified by:
getPluginKey
in interfacePluginKeyProvider
- Specified by:
getPluginKey
in interfaceTaskIdentifier
- Returns:
- Complete key of the task type plugin module
-
getUserDescription
- Specified by:
getUserDescription
in interfaceTaskIdentifier
- Returns:
- the description of the task as defined by the user
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceTaskIdentifier
- Returns:
- whether the task is enabled or disabled
-
isFinalising
public boolean isFinalising()- Specified by:
isFinalising
in interfaceTaskIdentifier
- Returns:
- true if the task should be run in finalisation phase
-
getBuildContext
-
getCommonContext
Description copied from interface:CommonTaskContext
Contains all the build related information about the running of the tasks- Specified by:
getCommonContext
in interfaceCommonTaskContext
- Returns:
-
getBuildLogger
Description copied from interface:CommonTaskContext
Returns the appropriate logger for the task- Specified by:
getBuildLogger
in interfaceCommonTaskContext
- Returns:
-
getRootDirectory
Description copied from interface:CommonTaskContext
Get build root directory (where sources were checked out)- Specified by:
getRootDirectory
in interfaceCommonTaskContext
- Returns:
- Build root directory
-
getWorkingDirectory
Description copied from interface:CommonTaskContext
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
Description copied from interface:CommonTaskContext
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
-
getRuntimeTaskData
- Specified by:
getRuntimeTaskData
in interfaceCommonTaskContext
- Returns:
- custom runtime data that complement static task configuration
-
doesTaskProduceTestResults
public boolean doesTaskProduceTestResults()- Specified by:
doesTaskProduceTestResults
in interfaceCommonTaskContext
-