-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for .NET8 container-based web apps
- Loading branch information
Showing
49 changed files
with
687 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ on: | |
branches: | ||
- main | ||
- dev | ||
- 'feature/**' | ||
|
||
permissions: | ||
id-token: write | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/AWS.Deploy.CLI/Commands/TypeHints/DockerHttpPortCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using AWS.Deploy.Common; | ||
using AWS.Deploy.Common.Recipes; | ||
using AWS.Deploy.Common.Recipes.Validation; | ||
using AWS.Deploy.Common.TypeHintData; | ||
using System.Threading.Tasks; | ||
|
||
namespace AWS.Deploy.CLI.Commands.TypeHints | ||
{ | ||
public class DockerHttpPortCommand : ITypeHintCommand | ||
{ | ||
private readonly IConsoleUtilities _consoleUtilities; | ||
private readonly IOptionSettingHandler _optionSettingHandler; | ||
|
||
public DockerHttpPortCommand(IConsoleUtilities consoleUtilities, IOptionSettingHandler optionSettingHandler) | ||
{ | ||
_consoleUtilities = consoleUtilities; | ||
_optionSettingHandler = optionSettingHandler; | ||
} | ||
|
||
public Task<TypeHintResourceTable> GetResources(Recommendation recommendation, OptionSettingItem optionSetting) => Task.FromResult(new TypeHintResourceTable()); | ||
|
||
public Task<object> Execute(Recommendation recommendation, OptionSettingItem optionSetting) | ||
{ | ||
var settingValue = _consoleUtilities | ||
.AskUserForValue( | ||
string.Empty, | ||
_optionSettingHandler.GetOptionSettingValue<string>(recommendation, optionSetting) ?? string.Empty, | ||
allowEmpty: false, | ||
resetValue: _optionSettingHandler.GetOptionSettingDefaultValue<string>(recommendation, optionSetting) ?? string.Empty, | ||
validators: async httpPort => await ValidateHttpPort(httpPort, recommendation, optionSetting)); | ||
|
||
var settingValueInt = int.Parse(settingValue); | ||
recommendation.DeploymentBundle.DockerfileHttpPort = settingValueInt; | ||
return Task.FromResult<object>(settingValueInt); | ||
} | ||
|
||
private async Task<string> ValidateHttpPort(string httpPort, Recommendation recommendation, OptionSettingItem optionSettingItem) | ||
{ | ||
var validationResult = await new RangeValidator() { Min = 0, Max = 65535 }.Validate(httpPort, recommendation, optionSettingItem); | ||
|
||
if (validationResult.IsValid) | ||
{ | ||
return string.Empty; | ||
} | ||
else | ||
{ | ||
return validationResult.ValidationFailedMessage ?? "Invalid value for Docker HTTP Port."; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.