project

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	Runtime     *runtime.Runtime
	Provisioner *provisioner.Provisioner
	Composer    *composer.Composer
	Workstation *workstation.Workstation
}

Project orchestrates the setup and initialization of a Windsor project. It coordinates context, provisioner, composer, and workstation managers to provide a unified interface for project initialization and management.

func NewProject

func NewProject(contextName string, opts ...*Project) (*Project, error)

NewProject creates and initializes a new Project instance with all required managers. It sets up the execution context, applies config defaults, and creates provisioner, composer, and workstation managers. The workstation is only created if the project is in dev mode. Returns the initialized Project or an error if any step fails. After creation, call Configure() to apply flag overrides if needed. Optional overrides can be provided via opts to inject mocks for testing. If opts contains a Project with Runtime set, that runtime will be reused.

func (*Project) Configure

func (p *Project) Configure(flagOverrides map[string]any) error

Configure loads configuration from disk and applies flag-based overrides. This should be called after NewProject if command flags need to override configuration values. Returns an error if loading or applying overrides fails.

func (*Project) Initialize

func (p *Project) Initialize(overwrite bool, blueprintURL ...string) error

Initialize runs the complete initialization sequence for the project. It prepares the workstation (creates services and assigns IPs), prepares context, generates infrastructure, prepares tools, and bootstraps the environment. The overwrite parameter controls whether infrastructure generation should overwrite existing files. The optional blueprintURL parameter specifies the blueprint artifact to load (OCI URL or local .tar.gz path). Returns an error if any step fails.

func (*Project) PerformCleanup

func (p *Project) PerformCleanup() error

PerformCleanup removes context-specific artifacts including volumes, terraform modules, and generated configuration files. It calls the config handler's Clean method to remove saved state, then deletes the .volumes directory, .windsor/contexts/<context> directory, .windsor/Corefile, and .windsor/docker-compose.yaml. Returns an error if any cleanup step fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL