Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/Aspire.Hosting.Docker/DockerComposeServiceResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public DockerComposeServiceResource(string name, IResource resource, DockerCompo
_composeEnvironmentResource = composeEnvironmentResource;

// Add pipeline step annotation to display endpoints after deployment
Annotations.Add(new PipelineStepAnnotation((factoryContext) =>
Annotations.Add(new PipelineStepAnnotation(_ =>
{
var steps = new List<PipelineStep>();

var printResourceSummary = new PipelineStep
{
Name = $"print-{resource.Name}-summary",
Action = async ctx => await PrintEndpointsAsync(ctx, composeEnvironmentResource).ConfigureAwait(false),
Name = $"print-{_targetResource.Name}-summary",
Action = async ctx => await PrintEndpointsAsync(ctx, _composeEnvironmentResource).ConfigureAwait(false),
Tags = ["print-summary"],
RequiredBySteps = [WellKnownPipelineSteps.Deploy]
};
Expand Down Expand Up @@ -309,13 +309,6 @@ private void AddVolumes(Service composeService)
private async Task PrintEndpointsAsync(PipelineStepContext context, DockerComposeEnvironmentResource environment)
{
var outputPath = PublishingContextUtils.GetEnvironmentOutputPath(context, environment);
var dockerComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml");

if (!File.Exists(dockerComposeFilePath))
{
context.Logger.LogWarning("Docker Compose file not found at {Path}", dockerComposeFilePath);
return;
}

try
{
Expand Down