cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirComponents = "components"
	DirBases      = "bases"
	DirProjects   = "projects"
)

Module directory constants

View Source
const (
	DirExamples  = "examples"
	DirModules   = "modules"
	DirTests     = "tests"
	DirSpacelift = ".spacelift"
)

Subdirectory constants

View Source
const (
	TypeComponent = "component"
	TypeBase      = "base"
	TypeProject   = "project"
)

Module type constants

View Source
const (
	FileSpaceliftConfig = "config.yml"
)

File constants

Variables

ModuleDirs contains all module directory names

View Source
var ModuleTypeOrder = map[string]int{
	TypeComponent: 1,
	TypeBase:      2,
	TypeProject:   3,
}

ModuleTypeOrder defines the sorting order for module types

Functions

func Execute

func Execute() error

Execute runs the root command

func RunOnModulesParallel added in v0.8.0

func RunOnModulesParallel(modules []ModuleInfo, parallelismCfg *config.ParallelismConfig, fn ModuleRunner) error

RunOnModulesParallel is a convenience function that uses the global parallelFlag along with config to run on modules. This is the primary entry point for commands using --changed.

Note: CLI flags are merged into config during PersistentPreRunE, so parallelismCfg already reflects any --max-parallel override.

Types

type ItemInfo

type ItemInfo struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

ItemInfo contains information about an example

type ModuleDetails

type ModuleDetails struct {
	Name             string     `json:"name"`
	Type             string     `json:"type"`
	Path             string     `json:"path"`
	HasSubmodules    bool       `json:"has_submodules"`
	HasTests         bool       `json:"has_tests"`
	HasExamples      bool       `json:"has_examples"`
	Submodules       []ItemInfo `json:"submodules,omitempty"`
	Examples         []ItemInfo `json:"examples,omitempty"`
	Tests            []ItemInfo `json:"tests,omitempty"`
	SpaceliftVersion string     `json:"spacelift_version,omitempty"`
}

ModuleDetails contains detailed information about a module

type ModuleInfo

type ModuleInfo struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Path    string `json:"path"`
	Version string `json:"version,omitempty"`
}

ModuleInfo holds information about a discovered module

type ModuleRunner added in v0.8.0

type ModuleRunner func(mod ModuleInfo, stdout, stderr io.Writer) error

ModuleRunner is a function that runs a command on a module with the given stdout and stderr writers.

Jump to

Keyboard shortcuts

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