buildcharts init scaffolds the files that BuildCharts needs to generate a Bake plan.
What scaffolding means in BuildCharts
Scaffolding is the step where BuildCharts inspects a repository, infers a reasonable starting build model, and writes the metadata files for you. At a high level, the goal is:- find recognizable project files
- infer which build stage types the repository needs
- generate a starter
build.yml - generate a matching
charts/buildcharts/Chart.yaml
How the current implementation works
The current implementation is file-type driven. It detects the repository type first, then applies language-specific scaffolding rules. Today, the only supported repository type is .NET:- a
.slnor.slnxfile identifies the repository as a supported .NET solution .csprojfiles are inspected to infer additional target types
What it creates
In a supported .NET repository,buildcharts init creates:
build.ymlcharts/buildcharts/Chart.yaml.github/workflows/buildcharts.ymlwhen the repository remote points to GitHub
What it detects
The current scaffolding flow is .NET-specific. It detects:- a
.slnor.slnxfile - test projects from common test package references such as
Microsoft.NET.Test.Sdk,xunit, ornunit - NuGet package projects from package metadata such as
<PackageId>or<GeneratePackageOnBuild>true</GeneratePackageOnBuild> - Docker targets when a project folder contains a local
Dockerfile - the .NET SDK version from
global.jsonor target frameworks
What the generated metadata looks like
The scaffoldedbuild.yml includes:
VERSIONandCOMMITvariables- one
buildtarget for the solution - additional
test,nuget, ordockertargets when matching projects are found
.NET. It also maps each discovered file to an appropriate stage type automatically.
What the generated chart file looks like
The scaffoldedChart.yaml maps default aliases to OCI-hosted charts:
buildtestnugetdocker