Table of Contents

Class ScriptGlobals

Namespace
Ando.Scripting
Assembly
ando.dll

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

buildContext BuildContext

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

AndoOperations

AppService

Azure App Service deployment operations. Usage: AppService.DeployZip("my-app", "./publish.zip", o => o.WithDeploymentSlot("staging"))

public AppServiceOperations AppService { get; }

Property Value

AppServiceOperations

Azure

Azure CLI authentication and account operations. Usage: Azure.EnsureLoggedIn(), Azure.SetSubscription("...")

public AzureOperations Azure { get; }

Property Value

AzureOperations

Bicep

Azure Bicep deployment operations. Usage: var deployment = Bicep.DeployToResourceGroup("rg", "./main.bicep"); Access outputs: deployment.Output("sqlConnectionString")

public BicepOperations Bicep { get; }

Property Value

BicepOperations

Cloudflare

Cloudflare operations (Pages deployment, etc.). Usage: Cloudflare.PagesDeploy(o => o.WithProjectName("my-site"))

public CloudflareOperations Cloudflare { get; }

Property Value

CloudflareOperations

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

DocfxOperations

Docker

Docker operations (build images). Usage: Docker.Build("Dockerfile", o => o.WithTag("myapp:v1.0.0"))

public DockerOperations Docker { get; }

Property Value

DockerOperations

Dotnet

Dotnet CLI operations (build, test, publish, etc.).

public DotnetOperations Dotnet { get; }

Property Value

DotnetOperations

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

DotnetSdkOperations

Ef

Entity Framework operations (database update, migrations, etc.).

public EfOperations Ef { get; }

Property Value

EfOperations

Functions

Azure Functions deployment operations. Usage: Functions.DeployZip("my-func", "./publish.zip", o => o.WithDeploymentSlot("staging"))

public FunctionsOperations Functions { get; }

Property Value

FunctionsOperations

Git

Git version control operations. Usage: Git.Tag(version), Git.Push(), Git.PushTags()

public GitOperations Git { get; }

Property Value

GitOperations

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

GitHubOperations

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

LogOperations

Node

Node.js installation operations (installs Node.js globally). Usage: Node.Install() or Node.Install("20")

public NodeInstallOperations Node { get; }

Property Value

NodeInstallOperations

Npm

npm operations (install, run, ci, etc.).

public NpmOperations Npm { get; }

Property Value

NpmOperations

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

NugetOperations

Playwright

Playwright E2E testing operations. Usage: Playwright.Test(e2eDir), Playwright.Install(e2eDir)

public PlaywrightOperations Playwright { get; }

Property Value

PlaywrightOperations

Root

Project root directory (where build.csando is located). Allows: Root / "dist"

public BuildPath Root { get; }

Property Value

BuildPath

Temp

Temporary files directory (root/.ando/tmp). Allows: Temp / "cache"

public BuildPath Temp { get; }

Property Value

BuildPath

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

name string

The 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

path string

Returns

DirectoryRef

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

name string

Environment variable name.

required bool

If 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.