Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions src/Aspire.Hosting.Docker/DockerComposeEnvironmentResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private async Task DockerComposeUpAsync(PipelineStepContext context)
}
else
{
await deployTask.CompleteAsync($"Docker Compose deployment complete for **{Name}**", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false);
await deployTask.CompleteAsync($"Service **{Name}** is now running with Docker Compose locally", CompletionState.Completed, context.CancellationToken).ConfigureAwait(false);
}
}
}
Expand Down Expand Up @@ -364,7 +364,7 @@ private string GetEnvFilePath(PipelineStepContext context)
var outputPath = PublishingContextUtils.GetEnvironmentOutputPath(context, this);
var hostEnvironment = context.Services.GetService<Microsoft.Extensions.Hosting.IHostEnvironment>();
var environmentName = hostEnvironment?.EnvironmentName ?? Name;
var envFilePath = Path.Combine(outputPath, $"{environmentName}.env");
var envFilePath = Path.Combine(outputPath, $".env.{environmentName}");
return envFilePath;
}
}
4 changes: 3 additions & 1 deletion src/Aspire.Hosting.Docker/DockerComposePublishingContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ private async Task WriteDockerComposeOutputAsync(DistributedApplicationModel mod
}
}

reportingStep.Log(LogLevel.Debug, "Writing the Docker Compose file to the output path.", enableMarkdown: false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This is not correct. Remove this and instead change the log level for the log over at

logger.FinishGeneratingDockerCompose(OutputPath);
.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit b561785. Removed the incorrect Debug log and changed the FinishGeneratingDockerCompose logger method from LogLevel.Information to LogLevel.Debug to reduce duplicate Info-level logs.


var writeTask = await reportingStep.CreateTaskAsync(
"Writing the Docker Compose file to the output path.",
"Generating Docker Compose output",
cancellationToken: cancellationToken).ConfigureAwait(false);

await using (writeTask.ConfigureAwait(false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public async Task PrepareStep_GeneratesCorrectEnvFileWithDefaultEnvironmentName(
var app = builder.Build();
app.Run();

var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, "Production.env"));
var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, ".env.Production"));
await Verify(envFileContent, "env")
.UseParameters("default-environment");
}
Expand Down Expand Up @@ -549,7 +549,7 @@ public async Task PrepareStep_GeneratesCorrectEnvFileWithCustomEnvironmentName()
app.Run();

// Verify that the env file is created with the custom environment name
var envFilePath = Path.Combine(tempDir.Path, "Staging.env");
var envFilePath = Path.Combine(tempDir.Path, ".env.Staging");
Assert.True(File.Exists(envFilePath), $"Expected env file at {envFilePath}");

var envFileContent = await File.ReadAllTextAsync(envFilePath);
Expand Down Expand Up @@ -583,7 +583,7 @@ public async Task PrepareStep_GeneratesEnvFileWithVariousParameterTypes()
var app = builder.Build();
app.Run();

var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, "Production.env"));
var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, ".env.Production"));
await Verify(envFileContent, "env")
.UseParameters("various-parameters");
}
Expand Down