Class ScriptGlobals
Global variables exposed to build.csando scripts. All properties are accessible as globals in script code.
public class ScriptGlobals
- Inheritance
-
ScriptGlobals
- Inherited Members
Constructors
ScriptGlobals(BuildContext)
public ScriptGlobals(BuildContext buildContext)
Parameters
buildContextBuildContext
Properties
Ando
ANDO operations for nested builds. Usage: Ando.Build(Directory("./website")) Usage: Ando.Build(Directory("./website"), o => o.WithDind())
public AndoOperations Ando { get; }
Property Value
AppService
Azure App Service deployment operations. Usage: AppService.DeployZip("my-app", "./publish.zip", o => o.WithDeploymentSlot("staging"))
public AppServiceOperations AppService { get; }
Property Value
Azure
Azure CLI authentication and account operations. Usage: Azure.EnsureLoggedIn(), Azure.SetSubscription("...")
public AzureOperations Azure { get; }
Property Value
Bicep
Azure Bicep deployment operations. Usage: var deployment = Bicep.DeployToResourceGroup("rg", "./main.bicep"); Access outputs: deployment.Output("sqlConnectionString")
public BicepOperations Bicep { get; }
Property Value
Cloudflare
Cloudflare operations (Pages deployment, etc.). Usage: Cloudflare.PagesDeploy(o => o.WithProjectName("my-site"))
public CloudflareOperations Cloudflare { get; }
Property Value
Docfx
DocFX operations for generating API documentation from C# XML comments. Usage: Docfx.Install(), Docfx.BuildAndCopy("./docfx.json", "_apidocs", "./website/public/apidocs")
public DocfxOperations Docfx { get; }
Property Value
Docker
Docker operations (build images). Usage: Docker.Build("Dockerfile", o => o.WithTag("myapp:v1.0.0"))
public DockerOperations Docker { get; }
Property Value
Dotnet
Dotnet CLI operations (build, test, publish, etc.).
public DotnetOperations Dotnet { get; }
Property Value
DotnetSdk
Legacy .NET SDK installation operations. Use Dotnet.SdkInstall() instead for new scripts. Usage: DotnetSdk.Install() or DotnetSdk.Install("9.0")
[Obsolete("Use Dotnet.SdkInstall() instead.")]
public DotnetSdkOperations DotnetSdk { get; }
Property Value
Ef
Entity Framework operations (database update, migrations, etc.).
public EfOperations Ef { get; }
Property Value
Functions
Azure Functions deployment operations. Usage: Functions.DeployZip("my-func", "./publish.zip", o => o.WithDeploymentSlot("staging"))
public FunctionsOperations Functions { get; }
Property Value
Git
Git version control operations. Usage: Git.Tag(version), Git.Push(), Git.PushTags()
public GitOperations Git { get; }
Property Value
GitHub
GitHub operations (PRs, releases, container registry). Usage: GitHub.CreatePr(o => o.WithTitle("...")) Usage: GitHub.CreateRelease(o => o.WithTag(version)) Usage: GitHub.PushImage("myapp", o => o.WithTag(version))
public GitHubOperations GitHub { get; }
Property Value
Log
Logging operations for build script output. Usage: Log.Info("message"), Log.Warning("message"), Log.Error("message"), Log.Debug("message")
public LogOperations Log { get; }
Property Value
Node
Node.js installation operations (installs Node.js globally). Usage: Node.Install() or Node.Install("20")
public NodeInstallOperations Node { get; }
Property Value
Npm
npm operations (install, run, ci, etc.).
public NpmOperations Npm { get; }
Property Value
Nuget
NuGet package operations (pack and push). Usage: Nuget.Pack(project, o => o.WithConfiguration(Configuration.Release)) Usage: Nuget.Push("./pkg/MyPackage.1.0.0.nupkg", o => o.ToNuGetOrg().WithApiKey(apiKey))
public NugetOperations Nuget { get; }
Property Value
Playwright
Playwright E2E testing operations. Usage: Playwright.Test(e2eDir), Playwright.Install(e2eDir)
public PlaywrightOperations Playwright { get; }
Property Value
Root
Project root directory (where build.csando is located). Allows: Root / "dist"
public BuildPath Root { get; }
Property Value
Temp
Temporary files directory (root/.ando/tmp). Allows: Temp / "cache"
public BuildPath Temp { get; }
Property Value
Methods
DefineProfile(string)
Defines a build profile that can be activated via CLI. Usage: var release = DefineProfile("release"); Then: if (release) { Git.Tag(version); } Activate via: ando -p release
public Profile DefineProfile(string name)
Parameters
namestringThe profile name.
Returns
- Profile
A Profile that evaluates to true when active.
Directory(string)
Creates a directory reference from a path. Usage: var frontend = Directory("./frontend"); Usage: var current = Directory(); // defaults to "."
public DirectoryRef Directory(string path = ".")
Parameters
pathstring
Returns
Env(string, bool)
Gets an environment variable value. By default, throws if the variable is not set. Pass required: false to return null instead. Usage: var apiKey = Env("API_KEY"); Usage: var optional = Env("OPTIONAL_VAR", required: false);
public string? Env(string name, bool required = true)
Parameters
namestringEnvironment variable name.
requiredboolIf true (default), throws when variable is not set. If false, returns null.
Returns
- string
The environment variable value, or null if not set and required is false.