aspirate 0.6.5-preview

This is a prerelease version of aspirate.
dotnet tool install --global aspirate --version 0.6.5-preview
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local aspirate --version 0.6.5-preview
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=aspirate&version=0.6.5-preview&prerelease
nuke :add-package aspirate --version 0.6.5-preview

nuget-icon

Aspirate (Aspir8)

Handle deployment yaml generation for a .NET Aspire AppHost

https://github.com/prom3theu5/aspirational-manifests/assets/1518610/319c4e1e-d47f-40e3-a8c3-ddf124b003a2

Documentation: https://prom3theu5.github.io/aspirational-manifests/

Table of Contents

  1. Installation as a global tool
  2. Producing Manifests
  3. Build
  4. Secrets Management
  5. Apply Manifests
  6. Remove Manifests
  7. Init Command
  8. Non-Interactive Invocation
  9. Uninstall tool
  10. Configuring the Windows Terminal For Unicode and Emoji Support
  11. DevContainer Support

To Install as a global tool

dotnet tool install -g aspirate --prerelease

NOTE: While Aspirate is in development the package will be versioned as a preview and the --prelease option will get the latest preview.

Producing Manifests

Navigate to your Aspire project's AppHost directory, and run:

aspirate generate

This command (by-default) will also build selected projects, and push the containers to the interpolated ContainerRegistry. Builds can be skipped by passing the --skip-build flag.

Your manifests will be in the AppHost/aspirate-output directory by default.

If you'd like - you can generate a slim docker-compose deployment instead of a kubernetes deployment. For this you can pass --output-format compose. Please note - this will disable secret support.

aspirate generate --output-format compose

Build

The Build command will build all projects defined in the aspire manifest file, and push the containers to the interpolated ContainerRegistry.

The command is extremely useful for rebuilding and pushing containers to the registry using a simple menu to select the items you want to build.

The command will first create the manifest file, however this can be overridden if you pass in the path to an existing manifest file using the --aspire-manifest or -m flag and supplying the path.

aspirate build

Secrets Management

Aspirate now includes built-in support for robust secret management, allowing you to easily encrypt sensitive data such as connection strings. This feature is designed to increase security and minimize vulnerabilities.

Managing Secrets

During the generate and apply processes, you will be prompted to input a password. This password is used to encrypt your secrets in the secrets file, named aspirate-secrets.json, located in the aspirate-output directory.

Secrets File Contents

The secrets file contains your encrypted secrets and is safe to commit to your Git repository. However, please handle this password with care. If it's lost, you'll be unable to access your encrypted secrets and you will need to use the generate command to create a new one.

Generating Secrets

The generate command provides an interactive menu during the generation process that allows you to use existing secrets, overwrite them, or update them.

Applying Secrets

The apply command will decrypt the secrets file and apply the secrets to the cluster, along with all the manifests.

Disabling Secret Management

If secrets are not required, the --disable-secrets flag can be passed to all commands to disable secret functionality. However, once manifests are generated with secrets included, they cannot be disabled without regenerating the manifests.

Apply Manifests

To apply the manifests to your cluster, run:

aspirate apply

Aspirate will first ask you which context they would like you to operate on, and will confirm first that you wish to act.

Remove Manifests

To remove the manifests from your cluster, run:

aspirate destroy

Aspirate will first ask you which context they would like you to operate on, and will confirm first that you wish to act.

Init

The init command allows you to bootstrap certain settings for an aspire project that Aspir8 will use.

  • ContainerRegistry: setting this means you do not need one in your csproj, and if it isn't found - all builds will use this.
  • ContainerTag - will override the container tag used if not in your csproj - if not specified in settings, will fall-back to latest.
  • TemplatePath - this customises the path used when loading templates that get transformed to manifests, you can take the templates folder from the source, and modify to your hearts content with all your custom changes, and as long as you don't remove the placeholders, aspirate will use those instead of its built in. More on this and possible use cases (such as adding jobs to create databases etc) when we have docs....

To use the init command, you simply run:

aspirate init

from within your AppHost directory - and it'll ask you which settings you'd like to override.

Non-Interactive Invocation

All commands apart from generate can be invoked non-interactively by passing the --non-interactive flag. Generate can be used if secrets are disabled.

This will cause the tool to use the default context and not prompt for confirmation.

When using this flag, all configuration arguments must be passed on the command line.

Uninstall tool

Aspirate can be uninstalled as a global tool by running:

dotnet tool uninstall -g aspirate

Configuring the Windows Terminal For Unicode and Emoji Support

Windows Terminal supports Unicode and Emoji. However, the shells such as Powershell and cmd.exe do not. For the difference between the two, see What's the difference between a console, a terminal and a shell.

For PowerShell, the following command will enable Unicode and Emoji support. You can add this to your profile.ps1 file:

[console]::InputEncoding = [console]::OutputEncoding = [System.Text.UTF8Encoding]::new()

For cmd.exe, the following steps are required to enable Unicode and Emoji support.

  1. Run intl.cpl.
  2. Click the Administrative tab
  3. Click the Change system locale button.
  4. Check the "Use Unicode UTF-8 for worldwide language support" checkbox.
  5. Reboot.

You will also need to ensure that your Console application is configured to use a font that supports Unicode and Emoji, such as Cascadia Code.

DevContainer Support

Aspirate can be used in a devcontainer by installing the feature:

features": {
  "ghcr.io/prom3theu5/aspirational-manifests/aspirate:latest": {}
}

An Example of a devcontainer can be found on the documentation page: Here

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.6.5-preview 136 4/26/2024
0.6.4-preview 42 4/26/2024
0.6.3-preview 50 4/26/2024
0.6.2-preview 109 4/24/2024
0.6.1-preview 40 4/24/2024
0.5.7-preview 64 4/24/2024
0.5.6-preview 206 4/19/2024
0.5.5-preview 201 4/15/2024
0.5.4-preview 59 4/15/2024
0.5.3-preview 109 4/11/2024
0.5.2-preview 54 4/11/2024
0.5.1-preview 58 4/11/2024
0.5.0-preview 50 4/11/2024
0.1.41-preview 92 4/9/2024
0.1.40-preview 1,035 2/26/2024
0.1.39-preview 296 2/14/2024
0.1.38-preview 67 2/14/2024
0.1.37-preview 109 2/13/2024
0.1.36-preview 360 1/13/2024
0.1.35-preview 183 1/2/2024
0.1.34-preview 64 1/2/2024
0.1.33-preview 84 12/31/2023
0.1.32-preview 79 12/30/2023
0.1.31-preview 92 12/30/2023
0.1.30-preview 84 12/29/2023
0.1.29-preview 188 12/23/2023
0.1.28-preview 98 12/23/2023
0.1.27-preview 72 12/23/2023
0.1.26-preview 106 12/21/2023
0.1.25-preview 67 12/21/2023
0.1.24-preview 82 12/20/2023
0.1.23-preview 76 12/20/2023
0.1.22-preview 84 12/20/2023
0.1.21-preview 117 12/16/2023
0.1.20-preview 87 12/15/2023
0.1.19-preview 119 12/13/2023
0.1.18-preview 162 12/10/2023
0.1.17-preview 79 12/10/2023
0.1.16-preview 77 12/10/2023
0.1.15-preview 71 12/10/2023
0.1.14-preview 87 12/9/2023
0.1.13-preview 93 12/9/2023
0.1.11-preview 115 12/6/2023
0.1.10-preview 114 12/1/2023

Initial Release