Documentation
¶
Index ¶
- Constants
- Variables
- func CollectTerraformEnvConfig(envs *TerraformEnvConfig) (map[string]string, map[string]string)
- func CreateProjectDependencyGraph(projects []Project) (graph.Graph[string, Project], error)
- func GetFilesWithExtension(workingDir string, ext string) ([]string, error)
- func GetPatternsRelativeToRepo(projectPath string, patterns []string) ([]string, error)
- func HandleYamlProjectGeneration(config *DiggerConfigYaml, terraformDir string) error
- func LoadDiggerConfig(workingDir string, generateProjects bool) (*DiggerConfig, *DiggerConfigYaml, graph.Graph[string, Project], error)
- func LoadDiggerConfigFromString(yamlString string, terraformDir string) (*DiggerConfig, *DiggerConfigYaml, graph.Graph[string, Project], error)
- func MatchIncludeExcludePatternsToFile(fileToMatch string, includePatterns []string, excludePatterns []string) bool
- func NormalizeFileName(fileName string) string
- func ValidateDiggerConfig(config *DiggerConfig) error
- func ValidateDiggerConfigYaml(configYaml *DiggerConfigYaml, fileName string) error
- type AssumeRoleForProject
- type AssumeRoleForProjectConfig
- type BlockYaml
- type DependencyConfiguration
- type DependencyConfigurationYaml
- type DiggerConfig
- func (c *DiggerConfig) GetDirectory(projectName string) string
- func (c *DiggerConfig) GetModifiedProjects(changedFiles []string) ([]Project, map[string]ProjectToSourceMapping)
- func (c *DiggerConfig) GetProject(projectName string) *Project
- func (c *DiggerConfig) GetProjects(projectName string) []Project
- func (c *DiggerConfig) GetWorkflow(workflowName string) *Workflow
- type DiggerConfigYaml
- type DirWalker
- type EnvVar
- type EnvVarYaml
- type File
- type FileSystemModuleDirWalker
- type FileSystemTerragruntDirWalker
- type FileSystemTopLevelTerraformDirWalker
- type GenerateProjectsConfigYaml
- type Project
- type ProjectToSourceMapping
- type ProjectYaml
- type Stage
- type StageYaml
- type Step
- type StepYaml
- type TerraformEnvConfig
- type TerraformEnvConfigYaml
- type TerragruntParsingConfig
- type Workflow
- type WorkflowConfiguration
- type WorkflowConfigurationYaml
- type WorkflowYaml
Constants ¶
View Source
const ( DependencyConfigurationHard = "hard" DependencyConfigurationSoft = "soft" )
hard - even if dependency project wasn't changed, it will be executed soft - if dependency project wasn't changed, it will be skipped
View Source
const CommentRenderModeBasic = "basic"
View Source
const CommentRenderModeGroupByModule = "group_by_module"
Variables ¶
View Source
var ErrDiggerConfigConflict = errors.New("more than one digger digger_config file detected, please keep either 'digger.yml' or 'digger.yaml'")
Functions ¶
func CollectTerraformEnvConfig ¶
func CollectTerraformEnvConfig(envs *TerraformEnvConfig) (map[string]string, map[string]string)
func GetFilesWithExtension ¶
func HandleYamlProjectGeneration ¶
func HandleYamlProjectGeneration(config *DiggerConfigYaml, terraformDir string) error
func LoadDiggerConfig ¶
func LoadDiggerConfig(workingDir string, generateProjects bool) (*DiggerConfig, *DiggerConfigYaml, graph.Graph[string, Project], error)
func LoadDiggerConfigFromString ¶
func LoadDiggerConfigFromString(yamlString string, terraformDir string) (*DiggerConfig, *DiggerConfigYaml, graph.Graph[string, Project], error)
func NormalizeFileName ¶
func ValidateDiggerConfig ¶
func ValidateDiggerConfig(config *DiggerConfig) error
func ValidateDiggerConfigYaml ¶
func ValidateDiggerConfigYaml(configYaml *DiggerConfigYaml, fileName string) error
Types ¶
type AssumeRoleForProject ¶
type BlockYaml ¶
type BlockYaml struct {
Include string `yaml:"include"`
Exclude string `yaml:"exclude"`
Workflow string `yaml:"workflow"`
AwsRoleToAssume *AssumeRoleForProjectConfig `yaml:"aws_role_to_assume,omitempty"`
}
type DependencyConfiguration ¶
type DependencyConfiguration struct {
Mode string
}
type DependencyConfigurationYaml ¶
type DependencyConfigurationYaml struct {
Mode string `yaml:"mode"`
}
type DiggerConfig ¶
type DiggerConfig struct {
ApplyAfterMerge bool
AllowDraftPRs bool
CommentRenderMode string
DependencyConfiguration DependencyConfiguration
Projects []Project
AutoMerge bool
Telemetry bool
Workflows map[string]Workflow
MentionDriftedProjectsInPR bool
TraverseToNestedProjects bool
}
func ConvertDiggerYamlToConfig ¶
func ConvertDiggerYamlToConfig(diggerYaml *DiggerConfigYaml) (*DiggerConfig, graph.Graph[string, Project], error)
func (*DiggerConfig) GetDirectory ¶
func (c *DiggerConfig) GetDirectory(projectName string) string
func (*DiggerConfig) GetModifiedProjects ¶
func (c *DiggerConfig) GetModifiedProjects(changedFiles []string) ([]Project, map[string]ProjectToSourceMapping)
func (*DiggerConfig) GetProject ¶
func (c *DiggerConfig) GetProject(projectName string) *Project
func (*DiggerConfig) GetProjects ¶
func (c *DiggerConfig) GetProjects(projectName string) []Project
func (*DiggerConfig) GetWorkflow ¶
func (c *DiggerConfig) GetWorkflow(workflowName string) *Workflow
type DiggerConfigYaml ¶
type DiggerConfigYaml struct {
ApplyAfterMerge *bool `yaml:"apply_after_merge"`
AllowDraftPRs *bool `yaml:"allow_draft_prs"`
DependencyConfiguration *DependencyConfigurationYaml `yaml:"dependency_configuration"`
Projects []*ProjectYaml `yaml:"projects"`
AutoMerge *bool `yaml:"auto_merge"`
CommentRenderMode *string `yaml:"comment_render_mode"`
Workflows map[string]*WorkflowYaml `yaml:"workflows"`
Telemetry *bool `yaml:"telemetry,omitempty"`
GenerateProjectsConfig *GenerateProjectsConfigYaml `yaml:"generate_projects"`
TraverseToNestedProjects *bool `yaml:"traverse_to_nested_projects"`
MentionDriftedProjectsInPR *bool `yaml:"mention_drifted_projects_in_pr"`
}
func AutoDetectDiggerConfig ¶
func AutoDetectDiggerConfig(workingDir string) (*DiggerConfigYaml, error)
func LoadDiggerConfigYaml ¶
func LoadDiggerConfigYaml(workingDir string, generateProjects bool) (*DiggerConfigYaml, error)
func LoadDiggerConfigYamlFromString ¶
func LoadDiggerConfigYamlFromString(yamlString string) (*DiggerConfigYaml, error)
type DirWalker ¶
type DirWalker interface {
GetDirs(workingDir string, config DiggerConfigYaml) ([]string, error)
}
type EnvVarYaml ¶
type FileSystemModuleDirWalker ¶
type FileSystemModuleDirWalker struct {
}
func (*FileSystemModuleDirWalker) GetDirs ¶
func (walker *FileSystemModuleDirWalker) GetDirs(workingDir string, configYaml *DiggerConfigYaml) ([]string, error)
type FileSystemTerragruntDirWalker ¶
type FileSystemTerragruntDirWalker struct {
}
func (*FileSystemTerragruntDirWalker) GetDirs ¶
func (walker *FileSystemTerragruntDirWalker) GetDirs(workingDir string, configYaml *DiggerConfigYaml) ([]string, error)
type FileSystemTopLevelTerraformDirWalker ¶
type FileSystemTopLevelTerraformDirWalker struct {
}
func (*FileSystemTopLevelTerraformDirWalker) GetDirs ¶
func (walker *FileSystemTopLevelTerraformDirWalker) GetDirs(workingDir string, configYaml *DiggerConfigYaml) ([]string, error)
type GenerateProjectsConfigYaml ¶
type GenerateProjectsConfigYaml struct {
Include string `yaml:"include"`
Exclude string `yaml:"exclude"`
Terragrunt bool `yaml:"terragrunt"`
Blocks []BlockYaml `yaml:"blocks"`
TerragruntParsingConfig *TerragruntParsingConfig `yaml:"terragrunt_parsing,omitempty"`
AwsRoleToAssume *AssumeRoleForProjectConfig `yaml:"aws_role_to_assume,omitempty"`
}
type ProjectToSourceMapping ¶
type ProjectYaml ¶
type ProjectYaml struct {
Name string `yaml:"name"`
Dir string `yaml:"dir"`
Workspace string `yaml:"workspace"`
Terragrunt bool `yaml:"terragrunt"`
OpenTofu bool `yaml:"opentofu"`
Workflow string `yaml:"workflow"`
WorkflowFile *string `yaml:"workflow_file""`
IncludePatterns []string `yaml:"include_patterns,omitempty"`
ExcludePatterns []string `yaml:"exclude_patterns,omitempty"`
DependencyProjects []string `yaml:"depends_on,omitempty"`
DriftDetection *bool `yaml:"drift_detection,omitempty"`
AwsRoleToAssume *AssumeRoleForProjectConfig `yaml:"aws_role_to_assume,omitempty"`
}
func (*ProjectYaml) UnmarshalYAML ¶
func (p *ProjectYaml) UnmarshalYAML(unmarshal func(interface{}) error) error
type StageYaml ¶
type StageYaml struct {
Steps []StepYaml `yaml:"steps"`
}
func (*StageYaml) ToCoreStage ¶
type StepYaml ¶
type StepYaml struct {
Action string
Value string
ExtraArgs []string `yaml:"extra_args,omitempty"`
Shell string
}
func (*StepYaml) ToCoreStep ¶
func (*StepYaml) UnmarshalYAML ¶
type TerraformEnvConfig ¶
type TerraformEnvConfigYaml ¶
type TerraformEnvConfigYaml struct {
State []EnvVarYaml `yaml:"state"`
Commands []EnvVarYaml `yaml:"commands"`
}
type TerragruntParsingConfig ¶
type TerragruntParsingConfig struct {
GitRoot *string `yaml:"gitRoot,omitempty"`
AutoPlan bool `yaml:"autoPlan"`
AutoMerge bool `yaml:"autoMerge"`
IgnoreParentTerragrunt *bool `yaml:"ignoreParentTerragrunt,omitempty"`
CreateParentProject bool `yaml:"createParentProject"`
IgnoreDependencyBlocks bool `yaml:"ignoreDependencyBlocks"`
Parallel *bool `yaml:"parallel,omitempty"`
CreateWorkspace bool `yaml:"createWorkspace"`
CreateProjectName bool `yaml:"createProjectName"`
DefaultTerraformVersion string `yaml:"defaultTerraformVersion"`
DefaultWorkflow string `yaml:"defaultWorkflow"`
FilterPath string `yaml:"filterPath"`
OutputPath string `yaml:"outputPath"`
PreserveWorkflows *bool `yaml:"preserveWorkflows,omitempty"`
PreserveProjects bool `yaml:"preserveProjects"`
CascadeDependencies *bool `yaml:"cascadeDependencies,omitempty"`
DefaultApplyRequirements []string `yaml:"defaultApplyRequirements"`
//NumExecutors int64 `yaml:"numExecutors"`
ProjectHclFiles []string `yaml:"projectHclFiles"`
CreateHclProjectChilds bool `yaml:"createHclProjectChilds"`
CreateHclProjectExternalChilds *bool `yaml:"createHclProjectExternalChilds,omitempty"`
UseProjectMarkers bool `yaml:"useProjectMarkers"`
ExecutionOrderGroups *bool `yaml:"executionOrderGroups"`
}
type Workflow ¶
type Workflow struct {
EnvVars *TerraformEnvConfig
Plan *Stage
Apply *Stage
Configuration *WorkflowConfiguration
}
type WorkflowConfiguration ¶
type WorkflowConfigurationYaml ¶
type WorkflowConfigurationYaml struct {
OnPullRequestPushed []string `yaml:"on_pull_request_pushed"`
OnPullRequestClosed []string `yaml:"on_pull_request_closed"`
// pull request converted to draft
OnPullRequestConvertedToDraft []string `yaml:"on_pull_request_to_draft"`
OnCommitToDefault []string `yaml:"on_commit_to_default"`
}
type WorkflowYaml ¶
type WorkflowYaml struct {
EnvVars *TerraformEnvConfigYaml `yaml:"env_vars"`
Plan *StageYaml `yaml:"plan,omitempty"`
Apply *StageYaml `yaml:"apply,omitempty"`
Configuration *WorkflowConfigurationYaml `yaml:"workflow_configuration"`
}
func (*WorkflowYaml) UnmarshalYAML ¶
func (w *WorkflowYaml) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.