PipelineStepModel.fromYaml constructor
PipelineStepModel.fromYaml(
- Map<String, dynamic> yamlMap
)
Implementation
factory PipelineStepModel.fromYaml(Map<String, dynamic> yamlMap) {
final stepMap = Map<String, dynamic>.from(yamlMap);
if (yamlMap['name'] == null || yamlMap['command'] == null) {
print('❌ Provide Stage name and command in pipeline');
exit(1);
}
return PipelineStepModel(
name: yamlMap['name'],
command: yamlMap['command'],
dependsOn: List<String>.from(stepMap['depends_on'] ?? []),
uploadOutput: yamlMap['upload_output'] ?? false,
outputPath: yamlMap['output_path'], // Load output path
notifySlack: yamlMap['notify_slack'] ?? false,
stopOnFailure: yamlMap['stop_on_failure'] ?? true,
customExitCondition: yamlMap['custom_exit_condition'],
);
}