Table of Contents

Class DevopsPipelineWriter

Namespace
Invex.StructuredText.AzureDevopsPipelines
Assembly
Invex.StructuredText.AzureDevopsPipelines.dll

Serializes a DevopsPipeline model to Azure Pipelines YAML. Expressions embedded in the model are rendered with DevopsExpressionPrinter.

public sealed class DevopsPipelineWriter
Inheritance
object
DevopsPipelineWriter

Examples

var writer = new DevopsPipelineWriter();
writer.Write(pipeline);
File.WriteAllText("azure-pipelines.yml", writer.TextWriter.ToString());

Remarks

The writer accumulates output in TextWriter; call ToString() to retrieve the YAML. Use a fresh writer (or Reset(int)) for each pipeline file.

Constructors

DevopsPipelineWriter()

public DevopsPipelineWriter()

Properties

TextWriter

The underlying text writer that accumulates the generated YAML.

public StructuredTextWriter TextWriter { get; init; }

Property Value

StructuredTextWriter

Methods

Write(DevopsPipeline)

Writes the complete pipeline YAML for devopsPipeline, dispatching to the appropriate shape (stages, extends, jobs, or steps) based on the union variant supplied.

public void Write(DevopsPipeline devopsPipeline)

Parameters

devopsPipeline DevopsPipeline

The pipeline model to serialize.