-
Notifications
You must be signed in to change notification settings - Fork 703
Add scripts to download aspire-cli #10254
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
Conversation
Only works with `https://aka.ms/dotnet/9.0/daily/aspire-cli-${os}-${arch}.{zip,.tar.gz}` style urls.
Co-authored-by: Copilot <[email protected]>
eng/scripts/get-aspire-cli.sh
Outdated
printf "Downloading from: %s\n" "$url" | ||
printf "Saving to: %s\n" "$filename" | ||
|
||
if curl -fsSL -o "$filename" "$url"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check with security experts but I believe we'd want to have explicit cert verification like: curl -fsSL --tlsv1.2 --cert-status -o "$filename" "$url"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also want to add a connect-timeout and a max-time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And max timeous, retries, etc.
eng/scripts/get-aspire-cli.ps1
Outdated
Write-Host "Saving to: $filename" | ||
|
||
try { | ||
Invoke-WebRequest -Uri $url -OutFile $filename -MaximumRedirection 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why such a high maximum redirect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet-install.ps1
has something similar - https://github.com/dotnet/install-scripts/blob/8b5963d70695cd89e8f5193e92e35510b5c55013/src/dotnet-install.ps1#L1018
But that function might be better. We could copy that here.
eng/scripts/get-aspire-cli.sh
Outdated
printf "Downloading from: %s\n" "$url" | ||
printf "Saving to: %s\n" "$filename" | ||
|
||
if curl -fsSL -o "$filename" "$url"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes to both
eng/scripts/get-aspire-cli.sh
Outdated
printf "Downloading from: %s\n" "$url" | ||
printf "Saving to: %s\n" "$filename" | ||
|
||
if curl -fsSL -o "$filename" "$url"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And max timeous, retries, etc.
What minimum version of powershell can the script here expect? |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
I have updated the scripts to be little more comprehensive. Issues:
|
Co-authored-by: Copilot <[email protected]>
@DamianEdwards I updated the script to add the PATH to the powershell session and the User PATH environment variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds cross-platform scripts to download and install the Aspire CLI, along with comprehensive usage documentation.
- Introduces a Bash script (
get-aspire-cli.sh
) for Unix-like systems - Introduces a PowerShell script (
get-aspire-cli.ps1
) for cross-platform use - Adds
README.md
with usage instructions, supported platforms, and troubleshooting
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
eng/scripts/get-aspire-cli.sh | New Bash script to download, validate, and install the CLI |
eng/scripts/get-aspire-cli.ps1 | New PowerShell script to download, validate, and install the CLI |
eng/scripts/README.md | Documentation for script usage, parameters, supported RIDs, and troubleshooting |
Comments suppressed due to low confidence (3)
eng/scripts/README.md:128
- The Supported Runtime Identifiers table marks
linux-arm64
as unsupported, but the scripts detect and support ARM64 on Linux. Please update this entry to match actual support.
| `linux-arm64` | ❌ |
eng/scripts/get-aspire-cli.sh:1
- [nitpick] There are no automated tests for this script; consider adding integration or unit tests (e.g., using a testing framework or CI job) to cover key behaviors and prevent regressions.
#!/usr/bin/env bash
eng/scripts/README.md:43
- [nitpick] The PowerShell script supports the common
-Verbose
switch (viaCmdletBinding
), but it isn't listed in the parameters table. Consider adding-Verbose
to the documented options.
| `-Help` | Show help message | |
Co-authored-by: Copilot <[email protected]>
The windows script exits the shell:
1 Add the helper flag near the top of
|
Scenario | Command | Result |
---|---|---|
Interactive dev console | iex "& { $(irm https://aka.ms/get-aspire-cli.ps1) }" |
Prompt returns; $env:PATH patched for this session; no shell exit. |
CI / scripted setup | pwsh -NoProfile -ExecutionPolicy Bypass -File get-aspire-cli.ps1 -Version 9.0 |
Process ends with exit 0 (or 1 on failure) – perfect for pipeline step status. |
That’s it: a two‑line guard preserves CI‑friendly exit codes and keeps local shells alive when you pipe the script through iex
.
One more thing:
This does not update the session path. |
/backport to release/9.4 |
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16301668214 |
Add scripts to download aspire-cli
This PR introduces two cross-platform scripts for downloading and installing the Aspire CLI from the official Microsoft distribution channels:
eng/scripts/get-aspire-cli.sh
- Bash script for Unix-like systems (Linux, macOS)eng/scripts/get-aspire-cli.ps1
- PowerShell script for cross-platform use (Windows, Linux, macOS)Both scripts provide feature parity and follow platform-specific best practices for robust, secure CLI installation.
Core Features
Download & Installation
https://aka.ms/dotnet/{version}/{quality}/aspire-cli-{os}-{arch}.{zip,tar.gz}
9.0
) and build qualities (default:daily
)$HOME/.aspire/bin
)9.0
version withdaily
quality is availablePATH Integration
GITHUB_PATH
)Platform Support
win-x64
,win-arm64
(ZIP archives)linux-x64
,linux-musl-x64
(tar.gz archives)osx-x64
,osx-arm64
(tar.gz archives)Security & Reliability
Developer Features
curl | bash
)Usage Examples
Bash Script
PowerShell Script
Documentation
eng/scripts/README.md
with detailed usage instructionsFixes #9642