Class AndoOperations
- Namespace
- Ando.Operations
- Assembly
- ando.dll
Core ANDO operations for build configuration, artifacts, and nested builds.
public class AndoOperations
- Inheritance
-
AndoOperations
- Inherited Members
Constructors
AndoOperations(StepRegistry, IBuildLogger, Func<string, string>, BuildOptions, ArtifactOperations, ProfileRegistry)
Creates a new AndoOperations instance.
public AndoOperations(StepRegistry registry, IBuildLogger logger, Func<string, string> containerToHostPath, BuildOptions buildOptions, ArtifactOperations artifactOperations, ProfileRegistry profileRegistry)
Parameters
registryStepRegistryStep registry for registering build steps.
loggerIBuildLoggerLogger for output.
containerToHostPathFunc<string, string>Function to translate container paths to host paths.
buildOptionsBuildOptionsBuild options for configuring the current build.
artifactOperationsArtifactOperationsArtifact operations for copying files to host.
profileRegistryProfileRegistryProfile registry for passing profiles to sub-builds.
Methods
Build(DirectoryRef, Action<AndoBuildOptions>?)
Runs a build script in the specified directory or file. The child build runs in a new isolated container with its own .env and context.
public void Build(DirectoryRef directory, Action<AndoBuildOptions>? configure = null)
Parameters
directoryDirectoryRefDirectory containing the build.csando file, or a path to a specific .csando file. Examples:
- Directory("./website") - runs build.csando in ./website
- Directory("./website") / "deploy.csando" - runs deploy.csando in ./website
configureAction<AndoBuildOptions>Optional configuration for the child build.
CopyArtifactsToHost(string, string)
Registers files or directories to be copied from the container to the host after the build completes successfully.
public void CopyArtifactsToHost(string containerPath, string hostPath)
Parameters
containerPathstringPath inside the container. Can be relative to /workspace (e.g., "dist", "./artifacts") or absolute (e.g., "/workspace/dist").
hostPathstringDestination path on the host machine. Can be relative to project root (e.g., "./dist") or absolute.
CopyZippedArtifactsToHost(string, string)
Registers files or directories to be archived and copied from the container to the host after the build completes successfully. Creates a single archive file for faster transfer of many small files.
public void CopyZippedArtifactsToHost(string containerPath, string hostPath)
Parameters
containerPathstringPath inside the container. Can be relative to /workspace (e.g., "dist", "./artifacts") or absolute (e.g., "/workspace/dist").
hostPathstringDestination on the host machine. Can be:
- A directory path (e.g., "./dist") - creates "artifacts.tar.gz" in that directory
- A .tar.gz file path (e.g., "./dist/output.tar.gz") - creates tar.gz archive
- A .zip file path (e.g., "./dist/output.zip") - creates zip archive
UseImage(string)
Sets the Docker image for the current build container. Must be called before any build steps execute.
public void UseImage(string image)
Parameters
imagestringDocker image name (e.g., "ubuntu:24.04", "mcr.microsoft.com/dotnet/sdk:9.0").