diff --git a/test/AWS.Deploy.DockerImageUploader/App.cs b/test/AWS.Deploy.DockerImageUploader/App.cs index ac4ee7aa..8750b27c 100644 --- a/test/AWS.Deploy.DockerImageUploader/App.cs +++ b/test/AWS.Deploy.DockerImageUploader/App.cs @@ -9,6 +9,10 @@ using System; using System.Threading.Tasks; using System.IO; +using System.Linq; +using AWS.Deploy.Common.Recipes; +using AWS.Deploy.Orchestration; +using AWS.Deploy.Orchestration.RecommendationEngine; namespace AWS.Deploy.DockerImageUploader { @@ -20,6 +24,7 @@ public class App private readonly IFileManager _fileManager; private readonly IDirectoryManager _directoryManager; private readonly IProjectDefinitionParser _projectDefinitionParser; + private readonly IRecipeHandler _recipeHandler; private readonly CLI.App _deployToolCli; private readonly List _testApps = new() { "WebApiNET6", "ConsoleAppTask" }; @@ -29,6 +34,7 @@ public App(IServiceProvider serviceProvider) _projectDefinitionParser = serviceProvider.GetRequiredService(); _fileManager = serviceProvider.GetRequiredService(); _directoryManager = serviceProvider.GetRequiredService(); + _recipeHandler = serviceProvider.GetRequiredService(); _deployToolCli = serviceProvider.GetRequiredService(); } @@ -49,9 +55,11 @@ public async Task Run() private async Task CreateImageAndPushToECR(string projectPath) { var projectDefinition = await _projectDefinitionParser.Parse(projectPath); - + var orchestratorSession = new OrchestratorSession(projectDefinition); + var recommendationEngine = new RecommendationEngine(orchestratorSession, _recipeHandler); + var recommendations = await recommendationEngine.ComputeRecommendations(); var dockerEngine = new DockerEngine.DockerEngine(projectDefinition, _fileManager, _directoryManager); - dockerEngine.GenerateDockerFile(); + dockerEngine.GenerateDockerFile(recommendations.First()); var configFilePath = Path.Combine(projectPath, "DockerImageUploaderConfigFile.json"); var deployArgs = new[] { "deploy", "--project-path", projectPath, "--diagnostics", "--apply", configFilePath, "--silent" };