config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Current = CIDConfig{}

Functions

func LoadConfigurationFile

func LoadConfigurationFile(config interface{}, file string) (err error)

Types

type BranchingConventionType

type BranchingConventionType string
const (
	BranchingGitFlow BranchingConventionType = "GitFlow"
)

type CIDConfig

type CIDConfig struct {
	CommandExecutionTypes []string `yaml:"command-execution-types,omitempty"`

	Paths       PathConfig
	Conventions ProjectConventions
	Env         map[string]string

	// Dependencies holds a key value map of required versions
	Dependencies map[string]string `yaml:"dependencies,omitempty"`

	// LocalTools holds a list to lookup locally installed tools for command execution
	LocalTools []PathDiscoveryRule `yaml:"localtools,omitempty"`

	// CatalogSources
	CatalogSources map[string]*catalog.Source `yaml:"catalog_sources,omitempty"`

	// Registry holding all known images, actions, workflows, ...
	Registry catalog.Config `yaml:"registry,omitempty"`
}

CIDConfig is the full struct of the configuration file

func LoadConfig

func LoadConfig(projectDirectory string) *CIDConfig

type CommitConventionType

type CommitConventionType string
const (
	ConventionalCommits CommitConventionType = "ConventionalCommits"
)

type PathConfig

type PathConfig struct {
	Artifact string `default:".dist"`
	Temp     string `default:".tmp"`
	Cache    string `default:""`
}

PathConfig contains the path configuration for build/tmp directories

func (PathConfig) ArtifactModule

func (c PathConfig) ArtifactModule(dir ...string) string

ArtifactModule returns dist folder for a specific module

func (PathConfig) ModuleCache

func (c PathConfig) ModuleCache(module string) string

ModuleCache returns the cache directory for a specific module

func (PathConfig) NamedCache

func (c PathConfig) NamedCache(name string) string

NamedCache returns the cache directory for a named cache

func (PathConfig) TempModule

func (c PathConfig) TempModule(name string) string

TempModule returns temp folder for a specific module

type PathDiscoveryRule added in v0.5.0

type PathDiscoveryRule struct {
	Binary         []string
	Lookup         []PathDiscoveryRuleLookup
	LookupSuffixes []string `yaml:"lookup-suffixes"`
	Path           string
	ResolvedBinary string
}

type PathDiscoveryRuleLookup added in v0.5.0

type PathDiscoveryRuleLookup struct {
	Key            string   `yaml:"key"`             // env name
	KeyAliases     []string `yaml:"key-aliases"`     // env aliases
	Directory      string   `yaml:"directory"`       // directory
	Version        string   `yaml:"version"`         // version
	VersionCommand string   `yaml:"version-command"` // command to get version
	VersionRegex   string   `yaml:"version-regex"`   // regex to extract version
}

PathDiscoveryRuleLookup is used to discover local tool installations based on ENV vars

type ProjectConventions

type ProjectConventions struct {
	Branching BranchingConventionType `default:"GitFlow"`
	Commit    CommitConventionType    `default:"ConventionalCommits"`
}

type ToolBinary

type ToolBinary struct {
	Binary  string `yaml:"binary"`
	Version string `yaml:"version"`
}

Jump to

Keyboard shortcuts

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