@PublicApi
public interface TaskConfiguratorHelper
Modifier and Type | Method and Description |
---|---|
void |
addJdkRequirement(@NotNull Set<Requirement> requirements,
@NotNull TaskDefinition taskDefinition,
@NotNull String cfgJdkLabel)
Add JDK requirement if JDK was defined in task configuration
|
void |
addSystemRequirementFromConfiguration(@NotNull Set<Requirement> requirements,
@NotNull TaskDefinition taskDefinition,
@NotNull String cfgKey,
@NotNull String requirementPrefix)
Add Executable requirement if Executable was defined in task configuration
|
@Nullable Requirement |
createRequirementFromConfiguration(@NotNull TaskDefinition taskDefinition,
@NotNull String cfgKey)
Creates a new Executable requirement if Executable was defined in task configuration
|
@NotNull Optional<TaskDefinition> |
extractTaskDefinition(@NotNull ActionParametersMap params)
Get the task definition for the task defined in the parameter map.
|
@NotNull Optional<TaskDefinition> |
getTaskDefinition(@NotNull ActionParametersMap params)
Deprecated.
since 6.2 use
extractTaskDefinition(ActionParametersMap) |
@NotNull List<TaskDefinition> |
getTaskDefinitions(ActionParametersMap params)
Get all the task definitions for the job or environment defined in the parameter map.
|
void |
populateContextWithConfiguration(@NotNull Map<String,Object> context,
@NotNull TaskDefinition taskDefinition,
@NotNull Iterable<String> keys)
Populate Freemarker context with selected data from task configuration.
|
void |
populateTaskConfigMapWithActionParameters(@NotNull Map<String,String> config,
@NotNull ActionParametersMap params,
@NotNull Iterable<String> keys)
Populate task configuration with selected data from action parameters.
|
void |
validateBuilderLabel(@NotNull ActionParametersMap params,
@NotNull ErrorCollection errorCollection)
Validate builder definition in action parameters
|
void |
validateJdk(@NotNull ActionParametersMap params,
@NotNull ErrorCollection errorCollection)
Validate JDK definition in action parameters
|
void |
validateTestResultsFilePattern(@NotNull ActionParametersMap params,
@NotNull ErrorCollection errorCollection)
Validate test results file pattern in action parameters
|
void |
validateTestResultsFilePatternIfCustomPatternSelected(@NotNull ActionParametersMap params,
@NotNull ErrorCollection errorCollection,
@NotNull String cfgTestResultsFilePatternOptionCustom)
Validate test results file pattern in action parameters when manual pattern is enabled by an option
|
void populateContextWithConfiguration(@NotNull @NotNull Map<String,Object> context, @NotNull @NotNull TaskDefinition taskDefinition, @NotNull @NotNull Iterable<String> keys)
context
- Freemarker contexttaskDefinition
- source of task configurationkeys
- keys for which values has to be copiedvoid populateTaskConfigMapWithActionParameters(@NotNull @NotNull Map<String,String> config, @NotNull @NotNull ActionParametersMap params, @NotNull @NotNull Iterable<String> keys)
config
- task configurationparams
- action parameterskeys
- keys for which values has to be copiedvoid addJdkRequirement(@NotNull @NotNull Set<Requirement> requirements, @NotNull @NotNull TaskDefinition taskDefinition, @NotNull @NotNull String cfgJdkLabel)
requirements
- requirements to be modifiedtaskDefinition
- task definitioncfgJdkLabel
- name of configuration key that specifies JDK labelvoid addSystemRequirementFromConfiguration(@NotNull @NotNull Set<Requirement> requirements, @NotNull @NotNull TaskDefinition taskDefinition, @NotNull @NotNull String cfgKey, @NotNull @NotNull String requirementPrefix)
requirements
- requirements to be modifiedtaskDefinition
- task definitioncfgKey
- name of configuration key that specifies label of system requirement to be addedrequirementPrefix
- prefix of the system requirement@Nullable @Nullable Requirement createRequirementFromConfiguration(@NotNull @NotNull TaskDefinition taskDefinition, @NotNull @NotNull String cfgKey)
taskDefinition
- task definitioncfgKey
- name of configuration key that specifies the system requirementvoid validateJdk(@NotNull @NotNull ActionParametersMap params, @NotNull @NotNull ErrorCollection errorCollection)
params
- action parameterserrorCollection
- target for adding validation errorsvoid validateBuilderLabel(@NotNull @NotNull ActionParametersMap params, @NotNull @NotNull ErrorCollection errorCollection)
params
- action parameterserrorCollection
- target for adding validation errorsvoid validateTestResultsFilePattern(@NotNull @NotNull ActionParametersMap params, @NotNull @NotNull ErrorCollection errorCollection)
params
- action parameterserrorCollection
- target for adding validation errorsvoid validateTestResultsFilePatternIfCustomPatternSelected(@NotNull @NotNull ActionParametersMap params, @NotNull @NotNull ErrorCollection errorCollection, @NotNull @NotNull String cfgTestResultsFilePatternOptionCustom)
params
- action parameterserrorCollection
- target for adding validation errorscfgTestResultsFilePatternOptionCustom
- value of an option that enables test results file pattern@Deprecated @NotNull @NotNull Optional<TaskDefinition> getTaskDefinition(@NotNull @NotNull ActionParametersMap params)
extractTaskDefinition(ActionParametersMap)
params
- The parameter map from the task.Optional
containing the existing task definition or empty if this is a new task.IllegalArgumentException
- if the parameter map does not represent a build or deployment task,
or if it represents both a build and deployment plan.@NotNull @NotNull Optional<TaskDefinition> extractTaskDefinition(@NotNull @NotNull ActionParametersMap params)
params
- The parameter map from the task.Optional
containing the existing task definition or empty if this is a new task.IllegalArgumentException
- if the parameter map does not represent a build or deployment task,
or if it represents both a build and deployment plan.@NotNull @NotNull List<TaskDefinition> getTaskDefinitions(ActionParametersMap params)
params
- The parameter map from a task in the job or environment.TaskDefinition
s for all the tasks in the job or environment.IllegalArgumentException
- if the parameter map does not represent a build or deployment task,
or if it represents both a build and deployment plan.Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.