A framework for provisioning local environments to a desired state, using the .NET SDK.
A framework for provisioning local environments to a desired state, using the .NET SDK.
A framework for provisioning local environments to a desired state, using the .NET SDK.
Currently in preview. Use at own risk.
In Cupboard, you define catalogs, manifests, and resources.
Start by creating a new console application targeting .NET 8.0.
Add a reference to the Cupboard NuGet package.
> dotnet new console
> dotnet add package CupboardLet's start by creating a manifest that defines what should be run.
Note that resources don't do anything when they're declared.
They describe what WILL be done when executed.
…When we have a Manifest, we need to create a Catalog containing the manifest.
We'll also add a condition that excludes non-Windows environments.
public sealed class MyWindowsComputer : Catalog
{
public override void Execute(CatalogContext context)
{
if (!context.Facts.IsWindows())
{
return;
}
context.UseManifest();
}
}To run the application, we need to add an application entry-point and create a CupboardHost.
We must also explicitly add the catalogs to the CupboardHostBuilder instance.
public static class Program
{
public static int Main(string[] args)
{
return CupboardHost.CreateBuilder()
.AddCatalog()
.Run(args);
}
}Now, open up a terminal in administrator mode and execute the build.
Cupboard will show you a summary of what will be changed, which you will have to approve.
…We're using Cake as a dotnet tool for building. So make sure that you've restored Cake by running the following in the repository root:
> dotnet tool restoreAfter that, running the build is as easy as writing:
> dotnet cakeCopyright (c) 2021 Patrik Svensson
No open issues yet, or sync has not completed.