Documentation
¶
Overview ¶
Package repositoryconfig reads the Chainloop configuration committed to a repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChainloopYMLNotFound = errors.New(".chainloop.yml not found")
ErrChainloopYMLNotFound indicates that neither supported config filename exists.
Functions ¶
func LoadProjectFromYML ¶
LoadProjectFromYML returns projectName from the nearest repository config.
Types ¶
type ChainloopYML ¶
type ChainloopYML struct {
ProjectName string `yaml:"projectName"`
ProjectVersion string `yaml:"projectVersion"`
Organization string `yaml:"organization,omitempty"`
RequireTrace *bool `yaml:"requireTrace,omitempty"`
WorkflowName string `yaml:"workflowName,omitempty"`
}
ChainloopYML represents the relevant fields in .chainloop.yml.
func FindChainloopYML ¶
func FindChainloopYML(dir string) *ChainloopYML
FindChainloopYML returns the nearest repository config, or nil when it cannot be loaded. Call LoadChainloopYML when the path or error is needed.
func LoadChainloopYML ¶
func LoadChainloopYML(dir string) (*ChainloopYML, string, error)
LoadChainloopYML loads the nearest .chainloop.yml (or .chainloop.yaml), walking from dir to the git repository root. In each directory, .yml takes precedence over .yaml. A config without projectName is still valid.
Click to show internal directories.
Click to hide internal directories.