pipelines

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactPipeline

type ArtifactPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

ArtifactPipeline provides artifact creation and distribution functionality

func NewArtifactPipeline

func NewArtifactPipeline() *ArtifactPipeline

NewArtifactPipeline creates a new ArtifactPipeline instance

func (*ArtifactPipeline) Execute

func (p *ArtifactPipeline) Execute(ctx context.Context) error

Execute runs the artifact pipeline, performing bundling operations and final artifact creation or distribution. The execution mode is determined by context values: - "artifactMode": "bundle" for file creation, "push" for registry distribution - "outputPath": output path for bundle mode - "tag": tag for both modes - "registryBase": registry base URL for push mode - "repoName": repository name for push mode

func (*ArtifactPipeline) Initialize

func (p *ArtifactPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the artifact pipeline components including artifact builder and bundlers. It initializes the components needed for artifact creation and distribution functionality.

type BasePipeline

type BasePipeline struct {
	// contains filtered or unexported fields
}

BasePipeline provides common pipeline functionality including config loading Specific pipelines should embed this and add their own dependencies

func NewBasePipeline

func NewBasePipeline() *BasePipeline

NewBasePipeline creates a new BasePipeline instance

func (*BasePipeline) Execute

func (p *BasePipeline) Execute(ctx context.Context) error

Execute provides a default implementation that can be overridden by specific pipelines

func (*BasePipeline) Initialize

func (p *BasePipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the base pipeline components including dependency injection container, shell interface, configuration handler, and shims. It resolves dependencies from the DI container and initializes core components required for pipeline execution.

type CheckPipeline

type CheckPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

CheckPipeline implements health checking functionality for tools and cluster nodes

func NewCheckPipeline

func NewCheckPipeline() *CheckPipeline

NewCheckPipeline creates a new CheckPipeline instance

func (*CheckPipeline) Execute

func (p *CheckPipeline) Execute(ctx context.Context) error

Execute performs the check operation based on the operation type specified in the context. It supports both "tools" and "node-health" operations, validating configuration and executing the appropriate check functionality with proper error handling and output formatting.

func (*CheckPipeline) Initialize

func (p *CheckPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the CheckPipeline by resolving dependencies

type ContextPipeline

type ContextPipeline struct {
	BasePipeline
}

ContextPipeline provides context management functionality It embeds BasePipeline and manages context-specific dependencies for Windsor CLI context operations.

func NewContextPipeline

func NewContextPipeline() *ContextPipeline

NewContextPipeline creates a new ContextPipeline instance

func (*ContextPipeline) Execute

func (p *ContextPipeline) Execute(ctx context.Context) error

Execute runs the context management logic based on the operation type. It supports both "get" and "set" operations specified through the context. For "get" operations, it returns the current context. For "set" operations, it sets the context and writes a reset token.

type DownPipeline

type DownPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

DownPipeline provides infrastructure teardown functionality for the down command

func NewDownPipeline

func NewDownPipeline() *DownPipeline

NewDownPipeline creates a new DownPipeline instance

func (*DownPipeline) Execute

func (p *DownPipeline) Execute(ctx context.Context) error

Execute runs the down pipeline, performing infrastructure teardown in reverse order: 1. Set environment variables globally in the process 2. Run blueprint cleanup (if not skipped) 3. Tear down the stack (if not skipped) 4. Tear down container runtime (if enabled) 5. Clean up context-specific artifacts (if clean flag is set)

func (*DownPipeline) Initialize

func (p *DownPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the down pipeline components including virtual machine, container runtime, network manager, stack, and blueprint handler. It only initializes the components needed for the infrastructure teardown phase.

type EnvPipeline

type EnvPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

EnvPipeline provides environment variable printing functionality

func NewDefaultEnvPipeline

func NewDefaultEnvPipeline() *EnvPipeline

NewDefaultEnvPipeline creates a new EnvPipeline with all default constructors

func NewEnvPipeline

func NewEnvPipeline() *EnvPipeline

NewEnvPipeline creates a new EnvPipeline instance

func (*EnvPipeline) Execute

func (p *EnvPipeline) Execute(ctx context.Context) error

Execute runs the environment variable logic by checking directory trust status, handling session reset, loading secrets if requested, collecting and injecting environment variables into the process, and printing them unless in quiet mode.

func (*EnvPipeline) Initialize

func (p *EnvPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize creates and registers all required components for the env pipeline including secrets providers and environment printers. It validates dependencies and ensures proper initialization of all components required for environment variable management.

type ExecPipeline

type ExecPipeline struct {
	BasePipeline
}

ExecPipeline provides command execution functionality with environment injection

func NewExecPipeline

func NewExecPipeline() *ExecPipeline

NewExecPipeline creates a new ExecPipeline instance

func (*ExecPipeline) Execute

func (p *ExecPipeline) Execute(ctx context.Context) error

Execute executes the command with the provided arguments. It expects the command and optional arguments to be provided in the context.

type HookPipeline

type HookPipeline struct {
	BasePipeline
}

HookPipeline provides shell hook installation functionality

func NewHookPipeline

func NewHookPipeline() *HookPipeline

NewHookPipeline creates a new HookPipeline instance

func (*HookPipeline) Execute

func (p *HookPipeline) Execute(ctx context.Context) error

Execute installs the shell hook for the specified shell type. It validates the shell type argument and calls the shell's InstallHook method. The shell type is passed through the context with the key "shellType".

type InitPipeline

type InitPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

InitPipeline handles the initialization of a Windsor project

func NewInitPipeline

func NewInitPipeline() *InitPipeline

NewInitPipeline creates a new InitPipeline instance

func (*InitPipeline) Execute

func (p *InitPipeline) Execute(ctx context.Context) error

Execute performs initialization by writing reset tokens, processing templates, handling blueprints separately, writing blueprint files, resolving Terraform modules, and generating final output files.

func (*InitPipeline) Initialize

func (p *InitPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the init pipeline components including dependency injection container, configuration handler, blueprint handler, tools manager, stack, generators, bundlers, services, virtual machine components, terraform resolvers, and template renderer. It applies default configuration early so that service creation can access correct configuration values.

type InstallPipeline

type InstallPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

InstallPipeline provides blueprint installation functionality

func NewInstallPipeline

func NewInstallPipeline() *InstallPipeline

NewInstallPipeline creates a new InstallPipeline instance

func (*InstallPipeline) Execute

func (p *InstallPipeline) Execute(ctx context.Context) error

Execute runs the blueprint installation process for the InstallPipeline. It installs the blueprint using the configured blueprint handler and, if the "wait" flag is set in the context, waits for kustomizations to become ready. Returns an error if configuration is not loaded, the blueprint handler is missing, installation fails, or waiting for kustomizations fails.

func (*InstallPipeline) Initialize

func (p *InstallPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the install pipeline components including blueprint handler. It only initializes the components needed for blueprint installation functionality since environment setup is handled by the env pipeline.

type MockBasePipeline

type MockBasePipeline struct {
	InitializeFunc func(injector di.Injector, ctx context.Context) error
	ExecuteFunc    func(ctx context.Context) error
}

MockBasePipeline is a mock implementation of the Pipeline interface

func NewMockBasePipeline

func NewMockBasePipeline() *MockBasePipeline

NewMockBasePipeline creates a new MockBasePipeline instance

func (*MockBasePipeline) Execute

func (m *MockBasePipeline) Execute(ctx context.Context) error

Execute calls the mock ExecuteFunc if set, otherwise returns nil

func (*MockBasePipeline) Initialize

func (m *MockBasePipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize calls the mock InitializeFunc if set, otherwise returns nil

type Pipeline

type Pipeline interface {
	Initialize(injector di.Injector, ctx context.Context) error
	Execute(ctx context.Context) error
}

Pipeline defines the interface for all command pipelines

func WithPipeline

func WithPipeline(injector di.Injector, ctx context.Context, pipelineName string) (Pipeline, error)

WithPipeline resolves or creates a pipeline instance from the DI container by name. If the pipeline already exists in the injector, it is returned directly. Otherwise, a new instance is constructed, initialized with the provided injector and context, registered in the DI container, and then returned. Returns an error if the pipeline name is unknown or initialization fails.

type PipelineConstructor

type PipelineConstructor func() Pipeline

PipelineConstructor defines a function that creates a new pipeline instance

type Shims

type Shims struct {
	Stat      func(name string) (os.FileInfo, error)
	Getenv    func(key string) string
	Setenv    func(key, value string) error
	ReadDir   func(name string) ([]os.DirEntry, error)
	ReadFile  func(name string) ([]byte, error)
	RemoveAll func(path string) error
}

Shims provides a testable interface for system operations used by pipelines. This struct-based approach allows for better isolation during testing by enabling dependency injection of mock implementations for file system and environment operations. Each pipeline can use its own Shims instance with customized behavior for testing scenarios.

func NewShims

func NewShims() *Shims

NewShims creates a new Shims instance with default system call implementations. The returned instance provides direct access to os package functions and can be used in production environments or as a base for creating test-specific variants.

type UpPipeline

type UpPipeline struct {
	BasePipeline
	// contains filtered or unexported fields
}

UpPipeline provides infrastructure deployment functionality for the up command

func NewUpPipeline

func NewUpPipeline() *UpPipeline

NewUpPipeline creates a new UpPipeline instance

func (*UpPipeline) Execute

func (p *UpPipeline) Execute(ctx context.Context) error

Execute performs the infrastructure deployment operations including tools installation, VM/container startup, networking configuration, stack deployment, and optional blueprint installation.

func (*UpPipeline) Initialize

func (p *UpPipeline) Initialize(injector di.Injector, ctx context.Context) error

Initialize sets up the up pipeline components including tools manager, virtual machine, container runtime, network manager, stack, and blueprint handler. It only initializes the components needed for the infrastructure deployment phase, since env and init pipelines handle the earlier setup phases. Initialize sets up the up pipeline components by first constructing all dependencies using the "with" methods, then initializing them in sequence. This ensures all dependencies are present before any initialization logic is invoked.

Jump to

Keyboard shortcuts

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