platformplatform / PlatformPlatform

🚀 Pre-alpha state. A platform designed for building enterprise-grade, multi-tenant products using Azure, .NET, React, TypeScript, Infrastructure as Code, etc.
https://platformplatform.github.io
MIT License
227 stars 25 forks source link

Enhance the CLI for setting up CI/CD and improve the first-time start of Aspire AppHost for better stability and usability #455

Closed tjementum closed 4 months ago

tjementum commented 4 months ago

Summary & Motivation

Update the configure-continuous-deployments command, so it now automatically triggers the Cloud Infrastructure - Deployment and Application - Build and Deploy GitHub workflows. This allows for a full setup of Azure infrastructure and CI/CD for application code by just answering two questions about naming of Azure resources, in addition to logging in to Azure and GitHub. After this, the entire process of setting up a fully automated CI/CD takes a few seconds, and the initial deployment takes about 45 minutes (primarily because of spinning up a full Azure container App Environment).

The configure-continuous-deployments has also been enhanced so it now only prompts users to log in to GitHub if they are not already authenticated, and a check has been added to ensure the user has Admin permissions on the repository, providing clear error messages if not (this avoids confusion when users tried to configure the PlatformPlatform repository without first forking). Also, the command has been further enhanced to handle multiple git remotes by prioritizing 'origin', which is beneficial in forked repository scenarios. Again, a challenge when the fork still has the PlatformPlatform repository in the upstream.

The configure-continuous-deployments has been updated to disable the two reusable workflows called Deploy container and Publish container, to avoid users trying to run these manually. And the command has also been updated to not ask the users to specify domain names for production and staging during setup. Instead, users can now add domain names post-setup, by changing the GitHub environment variables. Finally, the command has been updated to work whether the GitHub repository is cloned using SSH or HTTPS, and it now also works whether the Azure CLI has been configured to use e.g., YAML as the default output.

To enhance the first-time experience when cloning and running PlatformPlatform on localhost, the CLI command previously known as run has been renamed to dev. The getting started steps in README.md have been updated to instruct users to run dotnet run dev in the developer-cli folder. This command has been enhanced in several ways. It now ensures that Docker Desktop is running and now downloads all Docker images for SQL Server, Azure Storage Emulator, etc., showing the progress, before starting the Aspire AppHost. This ensures that the user is getting feedback that things are happening while also ensuring that the Aspire host will start successfully the first time. It previously failed with a timeout because downloading Docker images took too long. This adjustment significantly improves the first-time setup experience by providing continuous feedback during Docker image setup and enhancing the overall reliability of the startup process.

When running the CLI, it now also checks for the correct version of the .NET SDK (NET 8.0.200), the same way that all other dependencies are verified.

Checklist

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud