-
Notifications
You must be signed in to change notification settings - Fork 561
proposed feature for .net aspire #1257
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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
641e7d8
first
danmoseley 4e57d3e
more
danmoseley d4dcc92
devkit
danmoseley e0fbae4
rest of tests
danmoseley c2b2772
remove redundant
danmoseley 987957b
add 9 and 8
danmoseley 9dbe13a
add necessary customizations
danmoseley 86f4d88
remove unnecessary
danmoseley 71e16f7
thypo
danmoseley 544e64e
comments
danmoseley b7f6f8f
unix line endings..
danmoseley 6740631
typo
danmoseley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,64 @@ | ||
|
|
||
| # .NET Aspire (dotnetaspire) | ||
|
|
||
| This Feature installs .NET Aspire and if necessary the .NET (dotnet) that it depends on. Options are provided to choose a different version or additional versions. | ||
|
|
||
| ## OS Support | ||
|
|
||
| This Feature should work on recent versions of Debian/Ubuntu-based distributions that support .NET and have the `apt` package manager installed | ||
|
|
||
| `bash` is required to execute the `install.sh` script. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```json | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/dotnetaspire:1": {} | ||
| } | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| | Options Id | Description | Type | Default Value | | ||
| |-----|-----|-----|-----| | ||
| | version | .NET Aspire version. Use 'latest' for the latest supported version, '9.0' for the 9.0 version, 'X.Y' or 'X.Y.Z' for a specific version, or 'latest-daily' for the latest unsupported build. | string | latest | | ||
|
|
||
| ## Customizations | ||
|
|
||
| ### VS Code Extensions | ||
|
|
||
| - `ms-dotnettools.csdevkit` | ||
|
|
||
| ## Configuration examples | ||
|
|
||
| Installing only the latest .NET Aspire version (the default). | ||
|
|
||
| ``` jsonc | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/dotnetaspire:1": "latest" // or "" or {} | ||
| } | ||
| ``` | ||
|
|
||
| Installing .NET Aspire version 9.0. | ||
|
|
||
| ``` jsonc | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/dotnetaspire:1": "9.0" // or "" or {} | ||
| } | ||
| ``` | ||
|
|
||
| Installing the latest .NET Aspire unsupported build. | ||
|
|
||
| ``` jsonc | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/dotnetaspire:1": "latest-daily" // or "" or {} | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| ## OS Support | ||
|
|
||
| This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. | ||
|
|
||
| `bash` is required to execute the `install.sh` script. | ||
|
|
This file contains hidden or 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,42 @@ | ||
| { | ||
| "id": "dotnetaspire", | ||
| "version": "1.0.0", | ||
| "name": ".NET Aspire", | ||
| "documentationURL": "https://github.com/devcontainers/features/tree/main/src/dotnetaspire", | ||
| "description": "Installs .NET Aspire. See https://aka.ms/dotnetaspire", | ||
| "options": { | ||
| "version": { | ||
| "type": "string", | ||
| "proposals": [ | ||
| "latest daily", | ||
| "latest", | ||
| "9.0", | ||
| ], | ||
| "default": "9.0", | ||
| "description": "Select or enter a .NET Aspire version. Use 'latest' for the latest supported version, '9.0' for the 9.0 version, 'X.Y' or 'X.Y.Z' for a specific version, or 'latest-daily' for the latest unsupported build." | ||
| }, | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "ms-dotnettools.csdevkit", | ||
| "ms-azuretools.vscode-bicep", | ||
| "GitHub.copilot-chat", | ||
| "GitHub.copilot" | ||
| ], | ||
| "settings": { | ||
| "remote.autoForwardPorts": true, | ||
| "remote.autoForwardPortsSource": "hybrid", | ||
| "remote.otherPortsAttributes": { | ||
| "onAutoForward": "ignore" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "dependsOn": { | ||
| "ghcr.io/devcontainers/features/dotnet": { | ||
| "version": "8.0", | ||
| "additionalVersions": "9.0" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,49 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| #------------------------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
| #------------------------------------------------------------------------------------------------------------- | ||
| # | ||
| # Docs: https://github.com/devcontainers/features/tree/main/src/dotnet | ||
| # Maintainer: The .NET Aspire team at https://github.com/dotnet/aspire | ||
|
|
||
| set -e | ||
|
|
||
| # default to latest if not specified | ||
| VERSION="${VERSION:-"latest"}" | ||
|
|
||
| if [[ ! $VERSION =~ ^(9\.0|latest|latest-daily)$ ]]; then | ||
| echo "Error: VERSION must be either '9.0', '9.0.0', 'latest', or 'latest-daily' not: '$VERSION'." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ $VERSION =~ ^(9\.0|9\.0\.0|latest)$ ]]; then | ||
| VERSION="9.0.0" | ||
| fi | ||
|
|
||
| echo "Activating feature '.NET Aspire' version: $VERSION" | ||
|
|
||
| # Before .NET Aspire 9.0 install required `dotnet workload`: this is no longer necessary, as Aspire is | ||
| # installed when restoring Aspire projects. It's only necessary to install the appropriate version of the templates. | ||
|
|
||
|
|
||
| if [[ $VERSION =~ ^(9\.0\.0)$ ]]; then | ||
| dotnet new install Aspire.ProjectTemplates::$VERSION | ||
| else | ||
| # https://github.com/dotnet/aspire/blob/main/docs/using-latest-daily.md | ||
| dotnet nuget add source --name dotnet9 https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json | ||
|
|
||
| # If you use Package Source Mapping, you'll also need to add the following mappings to your NuGet.config | ||
| # <packageSourceMapping> | ||
| # <packageSource key="dotnet9"> | ||
| # <package pattern="Aspire.*" /> | ||
| # <package pattern="Microsoft.Extensions.ServiceDiscovery*" /> | ||
| # <package pattern="Microsoft.Extensions.Http.Resilience" /> | ||
| # </packageSource> | ||
| # </packageSourceMapping> | ||
|
|
||
| dotnet new install Aspire.ProjectTemplates::*-* --force | ||
| fi | ||
|
|
||
| echo "... done activating feature '.NET Aspire' version: $VERSION" |
This file contains hidden or 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,4 @@ | ||
| #!/bin/bash | ||
| export DOTNET_NOLOGO=true | ||
| export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true | ||
| export DOTNET_GENERATE_ASPNET_CERTIFICATE=false | ||
This file contains hidden or 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 @@ | ||
| #!/usr/bin/env bash |
This file contains hidden or 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 @@ | ||
| #!/usr/bin/env bash |
This file contains hidden or 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 @@ | ||
| #!/usr/bin/env bash |
This file contains hidden or 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,26 @@ | ||
| { | ||
| "install_dotnetaspire_exact_version": { | ||
| "image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
| "features": { | ||
| "dotnetaspire": { | ||
| "version": "9.0" | ||
| } | ||
| } | ||
| }, | ||
| "install_dotnetaspire_latest_version": { | ||
| "image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
| "features": { | ||
| "dotnetaspire": { | ||
| "version": "latest" | ||
| } | ||
| } | ||
| }, | ||
| "install_dotnetaspire_latest_daily_version": { | ||
| "image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
| "features": { | ||
| "dotnetaspire": { | ||
| "version": "latest-daily" | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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,24 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -e | ||
|
|
||
| # Run tests with `devcontainer features test -f dotnetaspire` in the parent of the src and test folders. | ||
|
|
||
| source dev-container-features-test-lib | ||
| source dotnet_env.sh | ||
|
|
||
danmoseley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| check "dotnet is installed in DOTNET_ROOT and execute permission is granted" \ | ||
| test -x "$DOTNET_ROOT/dotnet" | ||
|
|
||
| check "dotnet 8.0 is installed" \ | ||
| test "$($DOTNET_ROOT/dotnet --info | grep '8.0.')" | ||
|
|
||
| check "dotnet 9.0 is installed" \ | ||
| test "$($DOTNET_ROOT/dotnet --info | grep '9.0.')" | ||
|
|
||
| check "dotnetaspire templates are installed" \ | ||
| test "$DOTNET_ROOT/dotnet new aspire" | ||
|
|
||
| # There isn't currently a good way to check what version of the templates was installed. | ||
|
|
||
| reportResults | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.