Documentation
¶
Index ¶
Constants ¶
const ( DirComponents = "components" DirBases = "bases" DirProjects = "projects" )
Module directory constants
const ( DirExamples = "examples" DirModules = "modules" DirTests = "tests" DirSpacelift = ".spacelift" )
Subdirectory constants
const ( TypeComponent = "component" TypeBase = "base" TypeProject = "project" )
Module type constants
const (
FileSpaceliftConfig = "config.yml"
)
File constants
Variables ¶
var ModuleDirs = []string{DirComponents, DirBases, DirProjects}
ModuleDirs contains all module directory names
var ModuleTypeOrder = map[string]int{ TypeComponent: 1, TypeBase: 2, TypeProject: 3, }
ModuleTypeOrder defines the sorting order for module types
Functions ¶
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 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.