Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update image uploader console app to work with latest changes #797

Merged
merged 1 commit into from
Oct 17, 2023
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
12 changes: 10 additions & 2 deletions test/AWS.Deploy.DockerImageUploader/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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<string> _testApps = new() { "WebApiNET6", "ConsoleAppTask" };
Expand All @@ -29,6 +34,7 @@ public App(IServiceProvider serviceProvider)
_projectDefinitionParser = serviceProvider.GetRequiredService<IProjectDefinitionParser>();
_fileManager = serviceProvider.GetRequiredService<IFileManager>();
_directoryManager = serviceProvider.GetRequiredService<IDirectoryManager>();
_recipeHandler = serviceProvider.GetRequiredService<IRecipeHandler>();
_deployToolCli = serviceProvider.GetRequiredService<CLI.App>();
}

Expand All @@ -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" };
Expand Down
Loading