Table of Contents

Class EntryPoint

Namespace
Fabricator.Console
Assembly
Fabricator.Console.dll
[CompilationMapping(SourceConstructFlags.Module)]
public static class EntryPoint
Inheritance
EntryPoint
Inherited Members

Methods

main(IEnumerable<string>, IEnumerable<Resource>)

Performs tasks on the passed resources according to the passed arguments.

[CompilationArgumentCounts(new int[] { 1, 1 })]
public static int main(IEnumerable<string> args, IEnumerable<Resource> resources)

Parameters

args IEnumerable<string>

The command-line arguments: apply or check, optionally together with --brief and --dry-run.

resources IEnumerable<Resource>

The root resources, i.e., the resources describing the desired environment state.

Returns

int

The process exit code.

Remarks

The passed resources and all their dependencies (see DependsOn) are processed. When applying, a resource is checked and, if required, applied only after all its dependencies are applied; independent resources are processed in parallel. When only checking, all the resources are checked in parallel.

Before processing the resources, the stores of the secrets they require are opened (see Secrets). If a store asks for input, it is read from the console without echo, or, if the standard input is redirected, from the standard input line by line.

On the first Ctrl+C, no new resource checks or applications are started, the running ones are cancelled via their cancellation tokens, and the execution ends with an error after all of them have finished.

After the execution has finished (unless it was cancelled), a report listing every processed resource with its final state is printed. Under each resource line, the report shows the change the resource requires (for check) or has made (for apply), if the resource describes it (see ResourceChange); the --brief flag omits these details. If the output fails, the execution ends with an error.

With the --dry-run flag, the checks and applications are only listed, in the order of the report, without performing any of them or opening the secret stores. This allows quickly verifying (e.g. on CI) that the script compiles and builds its resources; it doesn't verify that the resource checks or applications would succeed.