Helpers for interacting with Helm CLI.
ILoggerIf you want to see how to get started, or want to know more about ModularPipelines, read the Wiki page here
await PipelineHostBuilder.Create()
.ConfigureAppConfiguration((context, builder) =>
{
builder.AddJsonFile("appsettings.json")
.AddUserSecrets<Program>()
.AddEnvironmentVariables();
})
.ConfigureServices((context, collection) =>
{
collection.Configure<NuGetSettings>(context.Configuration.GetSection("NuGet"));
collection.Configure<PublishSettings>(context.Configuration.GetSection("Publish"));
collection.AddSingleton<ISomeService1, SomeService1>();
collection.AddTransient<ISomeService2, SomeService2>();
})
.AddModule<FindNugetPackagesModule>()
.AddModule<UploadNugetPackagesModule>()
.ExecutePipelineAsync();public class FindNugetPackagesModule : Module<FileInfo>
{
private readonly ISomeService1 _someService1;
public FindNugetPackagesModule(ISomeService1 someService1)
{
_someService1 = someService1;
}
protected override async Task<List<File>?> ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken)
{
await _someService1.DoSomething();
return context.Git()
.RootDirectory
.GetFiles(path => path.Extension is ".nupkg")
.ToList();
}
}[DependsOn<FindNugetPackagesModule>]
public class UploadNugetPackagesModule : Module<FileInfo>
{
private readonly IOptions<NuGetSettings> _nugetSettings;
public UploadNugetPackagesModule(IOptions<NuGetSettings> nugetSettings)
{
_nugetSettings = nugetSettings;
}
protected override async Task<CommandResult?> ExecuteAsync(IPipelineContext context, CancellationToken cancellationToken)
{
var nugetFiles = await GetModule<FindNugetPackagesModule>();
return await context.NuGet()
.UploadPackages(new NuGetUploadOptions(packagePaths.Value!.AsPaths(), new Uri("https://api.nuget.org/v3/index.json"))
{
ApiKey = _nugetSettings.Value.ApiKey,
NoSymbols = true
});
}
}While I will try to limit breaking changes, there may be some changes within minor versions. These will be noted on release notes.