Hamelin.Runtimes.AzurePipelines
1.0.1
dotnet add package Hamelin.Runtimes.AzurePipelines --version 1.0.1
NuGet\Install-Package Hamelin.Runtimes.AzurePipelines -Version 1.0.1
<PackageReference Include="Hamelin.Runtimes.AzurePipelines" Version="1.0.1" />
<PackageVersion Include="Hamelin.Runtimes.AzurePipelines" Version="1.0.1" />
<PackageReference Include="Hamelin.Runtimes.AzurePipelines" />
paket add Hamelin.Runtimes.AzurePipelines --version 1.0.1
#r "nuget: Hamelin.Runtimes.AzurePipelines, 1.0.1"
#:package Hamelin.Runtimes.AzurePipelines@1.0.1
#addin nuget:?package=Hamelin.Runtimes.AzurePipelines&version=1.0.1
#tool nuget:?package=Hamelin.Runtimes.AzurePipelines&version=1.0.1
Hamelin.Runtimes.AzurePipelines
This package adds integration for running Hamelin pipelines in an Azure Pipelines environment.
Installation
To install the package, you can use the following command:
dotnet add package Hamelin.Runtimes.AzurePipelines
Usage
Registration
To add Azure Pipelines runtime support to your Hamelin pipeline, you can use the AddAzurePipelinesRuntime extension method on the IServiceCollection.
Runtime integration will only be fully registered if the AzurePipelinesRuntimeOptions.RuntimeDetector detects that the application is running in an Azure Pipelines environment. See Runtime Detection for more details.
using Hamelin;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var builder = PipelineApplication.CreateBuilder(args);
builder.Services
.AddAzurePipelinesRuntime();
// ...
var pipeline = builder.Build();
// ...
await pipeline.RunAsync();
Options
You can configure the Azure Pipelines runtime by providing options to the AddAzurePipelinesRuntime method. The options allow you to customize the behavior of the runtime, such as the runtime detector and logging settings.s
Runtime Detection
The runtime integration will only be fully registered if the RuntimeDetector delegate returns true. By default, this is done by checking for the presence of the TF_BUILD environment variable. If you need to customize this behavior, you can provide your own RuntimeDetector implementation.
If the runtime isn't detected, you will still be able to inject IAzurePipelinesCommands into your pipeline steps, but a stub implementation will be resolved instead.
If you need to check if the runtime is detected, you can inject the IAzurePipelinesContext interface, which provides an IsEnabled property.
Logging
The Azure Pipelines integration includes a logging formatter that adapts the logging output for Azure Pipelines. Warnings and errors are raised as issues on the pipeline.
Commands
With the Azure Pipelines integration registered, you can inject the IAzurePipelinesCommands interface into your pipeline steps to run commands in the Azure Pipelines environment, including manually writing logs, grouping log messages and setting outputs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Hamelin (>= 1.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Logging.Console (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.