Documentation
¶
Index ¶
- Variables
- func LoadConfigurationFile(config interface{}, file string) (err error)
- type Action
- type ActionAccess
- type ActionScope
- type ActionType
- type BinaryExecutionCandidate
- type BranchingConventionType
- type CIDConfig
- func (c *CIDConfig) FindAction(name string) *Action
- func (c *CIDConfig) FindExecutionCandidates(binary string, constraint string, preferExecutionType ExecutionType, ...) []BinaryExecutionCandidate
- func (c *CIDConfig) FindImageOfBinary(binary string, constraint string) *ToolContainerImage
- func (c *CIDConfig) FindPathOfBinary(binary string, constraint string) *ToolLocal
- func (c *CIDConfig) FindWorkflow(name string) *Workflow
- type Catalog
- type CommitConventionType
- type ContainerAction
- type ContainerMount
- type ExecutionType
- type PathConfig
- type PreferVersion
- type ProjectConventions
- type ToolBinary
- type ToolCacheDir
- type ToolContainerImage
- type ToolLocal
- type ToolLocalLookup
- type ToolSecurity
- type Workflow
- type WorkflowAction
- type WorkflowExpressionType
- type WorkflowRule
- type WorkflowStage
Constants ¶
This section is empty.
Variables ¶
var Current = CIDConfig{}
Functions ¶
func LoadConfigurationFile ¶
Types ¶
type Action ¶
type Action struct {
Repository string `required:"true" yaml:"repository"`
Name string `required:"true" yaml:"name"`
Enabled bool `default:"true" yaml:"enabled,omitempty"`
Type ActionType `required:"true" yaml:"type"`
Container ContainerAction `yaml:"container,omitempty"` // Container contains the configuration for containerized actions
Description string `yaml:"description"`
Version string `yaml:"version"`
Scope ActionScope `required:"true" yaml:"scope"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Access ActionAccess `yaml:"access"`
}
type ActionAccess ¶
type ActionAccess struct {
Env []string `yaml:"env"`
}
type ActionScope ¶
type ActionScope string
const ( ActionScopeProject ActionScope = "project" ActionScopeModule ActionScope = "module" )
type ActionType ¶
type ActionType string
const ( ActionTypeBuiltinGolang ActionType = "builtin-golang" ActionTypeContainer ActionType = "container" ActionTypeGitHubAction ActionType = "githubaction" )
type BinaryExecutionCandidate ¶
type BinaryExecutionCandidate struct {
Binary string
Version string
Type ExecutionType
// File holds the absolute path to the executable file
File string
// Image holds the container image
Image string
// ImageCache holds information about caching for containers
ImageCache []ToolCacheDir
// Mounts
Mounts []ContainerMount
// Security
Security ToolSecurity
}
type BranchingConventionType ¶
type BranchingConventionType string
const (
BranchingGitFlow BranchingConventionType = "GitFlow"
)
type CIDConfig ¶
type CIDConfig struct {
Paths PathConfig
Mode ExecutionType `default:"PREFER_LOCAL"`
Conventions ProjectConventions
Env map[string]string
// Catalog holds all currently known actions
Catalog Catalog `yaml:"catalog,omitempty"`
// Workflows holds all available workflows
Workflows []Workflow `yaml:"workflows,omitempty"`
// 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 []ToolLocal `yaml:"localtools,omitempty"`
// ContainerImages holds a list of images that provide tools for command execution
ContainerImages []ToolContainerImage `yaml:"containerimages,omitempty"`
}
CIDConfig is the full stuct of the configuration file
func LoadConfig ¶
func (*CIDConfig) FindAction ¶
FindAction finds an action by id
func (*CIDConfig) FindExecutionCandidates ¶
func (c *CIDConfig) FindExecutionCandidates(binary string, constraint string, preferExecutionType ExecutionType, preferVersion PreferVersion) []BinaryExecutionCandidate
FindExecutionCandidates returns a full list of all available execution options for the specified binary
func (*CIDConfig) FindImageOfBinary ¶
func (c *CIDConfig) FindImageOfBinary(binary string, constraint string) *ToolContainerImage
FindImageOfBinary retrieves information about the container image for the specified binary fulfilling the constraint
func (*CIDConfig) FindPathOfBinary ¶
FindPathOfBinary retrieves information about the local path of the specified binary fulfilling the constraint
func (*CIDConfig) FindWorkflow ¶
FindWorkflow finds a workflow by name
type CommitConventionType ¶
type CommitConventionType string
const (
ConventionalCommits CommitConventionType = "ConventionalCommits"
)
type ContainerAction ¶
type ContainerMount ¶
type ExecutionType ¶
type ExecutionType string
const ( ExecutionExec ExecutionType = "exec" ExecutionContainer ExecutionType = "container" )
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 PreferVersion ¶
type PreferVersion string
const ( PreferHighest PreferVersion = "highest" PreferLowest PreferVersion = "lowest" )
type ProjectConventions ¶
type ProjectConventions struct {
Branching BranchingConventionType `default:"GitFlow"`
Commit CommitConventionType `default:"ConventionalCommits"`
PreReleaseSuffix string `default:"-rc.{NCI_LASTRELEASE_COMMIT_AFTER_COUNT}"`
}
type ToolBinary ¶
type ToolCacheDir ¶
type ToolContainerImage ¶
type ToolContainerImage struct {
Provides []ToolBinary `yaml:"provides"`
Image string `yaml:"image"`
Cache []ToolCacheDir `yaml:"cache"`
Security ToolSecurity `yaml:"security"`
User string `yaml:"user"`
// Mounts
Mounts []ContainerMount `yaml:"mounts,omitempty"`
}
type ToolLocal ¶
type ToolLocal struct {
Binary []string
Lookup []ToolLocalLookup
LookupSuffixes []string `yaml:"lookup-suffixes"`
Path string
ResolvedBinary string
}
type ToolLocalLookup ¶
ToolLocalLookup is used to discover local tool installations based on ENV vars
type ToolSecurity ¶
type Workflow ¶
type Workflow struct {
Name string `required:"true" yaml:"name,omitempty"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Stages []WorkflowStage `yaml:"stages,omitempty"`
}
func (*Workflow) ActionCount ¶
ActionCount returns the total count of actions across all stages
type WorkflowAction ¶
type WorkflowAction struct {
ID string `required:"true" yaml:"id"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Config interface{} `yaml:"config,omitempty"`
Module *analyzerapi.ProjectModule `yaml:"-"`
}
type WorkflowExpressionType ¶
type WorkflowExpressionType string
const (
WorkflowExpressionCEL WorkflowExpressionType = "cel"
)
type WorkflowRule ¶
type WorkflowRule struct {
Type WorkflowExpressionType `default:"cel" yaml:"type,omitempty"`
Expression string `yaml:"expression,omitempty"`
}
type WorkflowStage ¶
type WorkflowStage struct {
Name string `required:"true" yaml:"name,omitempty"`
Rules []WorkflowRule `yaml:"rules,omitempty"`
Actions []WorkflowAction `yaml:"actions,omitempty"`
}