Documentation ¶
Overview ¶
Package raw contains the golang representations of the YAML elements supported in atlantis.yaml. The structs here represent the exact data that comes from the file before it is parsed/validated further.
Index ¶
- Constants
- Variables
- func DefaultAutoPlan() valid.Autoplan
- func VersionValidator(value interface{}) error
- type Autoplan
- type GlobalCfg
- type Metrics
- type PolicyOwners
- type PolicySet
- type PolicySets
- type Project
- type Prometheus
- type Repo
- type RepoCfg
- type Stage
- type Statsd
- type Step
- type Workflow
- type WorkflowHook
- func (s *WorkflowHook) MarshalJSON() ([]byte, error)
- func (s WorkflowHook) MarshalYAML() (interface{}, error)
- func (s WorkflowHook) ToValid() *valid.WorkflowHook
- func (s *WorkflowHook) UnmarshalJSON(data []byte) error
- func (s *WorkflowHook) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (s WorkflowHook) Validate() error
Constants ¶
const ( DefaultWorkspace = "default" ApprovedApplyRequirement = "approved" MergeableApplyRequirement = "mergeable" UnDivergedApplyRequirement = "undiverged" )
const ( ExtraArgsKey = "extra_args" NameArgKey = "name" CommandArgKey = "command" ValueArgKey = "value" RunStepName = "run" PlanStepName = "plan" ShowStepName = "show" PolicyCheckStepName = "policy_check" ApplyStepName = "apply" InitStepName = "init" EnvStepName = "env" MultiEnvStepName = "multienv" )
const DefaultAutomerge = false
DefaultAutomerge is the default setting for automerge.
const DefaultDeleteSourceBranchOnMerge = false
DefaultDeleteSourceBranchOnMerge being false is the default setting whether or not to remove a source branch on merge
const DefaultParallelApply = false
DefaultParallelApply is the default setting for parallel apply
const DefaultParallelPlan = false
DefaultParallelPlan is the default setting for parallel plan
const DefaultParallelPolicyCheck = false
DefaultParallelPolicyCheck is the default setting for parallel plan
Variables ¶
var DefaultAutoPlanWhenModified = []string{"**/*.tf*", "**/terragrunt.hcl"}
DefaultAutoPlanWhenModified is the default element in the when_modified list if none is defined.
Functions ¶
func DefaultAutoPlan ¶
DefaultAutoPlan returns the default autoplan config.
func VersionValidator ¶
func VersionValidator(value interface{}) error
VersionValidator helper function to validate binary version. Function implements ozzo-validation::Rule.Validate interface.
Types ¶
type Autoplan ¶
type GlobalCfg ¶
type GlobalCfg struct { Repos []Repo `yaml:"repos" json:"repos"` Workflows map[string]Workflow `yaml:"workflows" json:"workflows"` PolicySets PolicySets `yaml:"policies" json:"policies"` Metrics Metrics `yaml:"metrics" json:"metrics"` }
GlobalCfg is the raw schema for server-side repo config.
type Metrics ¶ added in v0.19.3
type Metrics struct { Statsd *Statsd `yaml:"statsd" json:"statsd"` Prometheus *Prometheus `yaml:"prometheus" json:"prometheus"` }
type PolicyOwners ¶
type PolicyOwners struct {
Users []string `yaml:"users,omitempty" json:"users,omitempty"`
}
func (PolicyOwners) ToValid ¶
func (o PolicyOwners) ToValid() valid.PolicyOwners
type PolicySet ¶
type PolicySet struct { Path string `yaml:"path" json:"path"` Source string `yaml:"source" json:"source"` Name string `yaml:"name" json:"name"` Owners PolicyOwners `yaml:"owners,omitempty" json:"owners,omitempty"` }
type PolicySets ¶
type PolicySets struct { Version *string `yaml:"conftest_version,omitempty" json:"conftest_version,omitempty"` Owners PolicyOwners `yaml:"owners,omitempty" json:"owners,omitempty"` PolicySets []PolicySet `yaml:"policy_sets" json:"policy_sets"` }
PolicySets is the raw schema for repo-level atlantis.yaml config.
func (PolicySets) ToValid ¶
func (p PolicySets) ToValid() valid.PolicySets
func (PolicySets) Validate ¶
func (p PolicySets) Validate() error
type Project ¶
type Project struct { Name *string `yaml:"name,omitempty"` Dir *string `yaml:"dir,omitempty"` Workspace *string `yaml:"workspace,omitempty"` Workflow *string `yaml:"workflow,omitempty"` TerraformVersion *string `yaml:"terraform_version,omitempty"` Autoplan *Autoplan `yaml:"autoplan,omitempty"` ApplyRequirements []string `yaml:"apply_requirements,omitempty"` DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"` ExecutionOrderGroup *int `yaml:"execution_order_group,omitempty"` }
type Prometheus ¶ added in v0.19.5
type Prometheus struct {
Endpoint string `yaml:"endpoint" json:"endpoint"`
}
func (*Prometheus) Validate ¶ added in v0.19.5
func (p *Prometheus) Validate() error
type Repo ¶
type Repo struct { ID string `yaml:"id" json:"id"` Branch string `yaml:"branch" json:"branch"` ApplyRequirements []string `yaml:"apply_requirements" json:"apply_requirements"` PreWorkflowHooks []WorkflowHook `yaml:"pre_workflow_hooks" json:"pre_workflow_hooks"` Workflow *string `yaml:"workflow,omitempty" json:"workflow,omitempty"` PostWorkflowHooks []WorkflowHook `yaml:"post_workflow_hooks" json:"post_workflow_hooks"` AllowedWorkflows []string `yaml:"allowed_workflows,omitempty" json:"allowed_workflows,omitempty"` AllowedOverrides []string `yaml:"allowed_overrides" json:"allowed_overrides"` AllowCustomWorkflows *bool `yaml:"allow_custom_workflows,omitempty" json:"allow_custom_workflows,omitempty"` DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty" json:"delete_source_branch_on_merge,omitempty"` }
Repo is the raw schema for repos in the server-side repo config.
func (Repo) HasRegexBranch ¶
HasRegexBranch returns true if a branch regex was set.
func (Repo) HasRegexID ¶
HasRegexID returns true if r is configured with a regex id instead of an exact match id.
type RepoCfg ¶
type RepoCfg struct { Version *int `yaml:"version,omitempty"` Projects []Project `yaml:"projects,omitempty"` Workflows map[string]Workflow `yaml:"workflows,omitempty"` PolicySets PolicySets `yaml:"policies,omitempty"` Automerge *bool `yaml:"automerge,omitempty"` ParallelApply *bool `yaml:"parallel_apply,omitempty"` ParallelPlan *bool `yaml:"parallel_plan,omitempty"` DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"` AllowedRegexpPrefixes []string `yaml:"allowed_regexp_prefixes,omitempty"` }
RepoCfg is the raw schema for repo-level atlantis.yaml config.
type Step ¶
type Step struct { // Key will be set in case #1 and #3 above to the key. In case #2, there // could be multiple keys (since the element is a map) so we don't set Key. Key *string // Env will be set in case #2 above. Env map[string]map[string]string // Map will be set in case #3 above. Map map[string]map[string][]string // StringVal will be set in case #4 above. StringVal map[string]string }
Step represents a single action/command to perform. In YAML, it can be set as 1. A single string for a built-in command:
- init
- plan
- policy_check
2. A map for an env step with name and command or value
- env: name: test command: echo 312 value: value
3. A map for a built-in command and extra_args:
- plan: extra_args: [-var-file=staging.tfvars]
4. A map for a custom run command:
- run: my custom command
Here we parse step in the most generic fashion possible. See fields for more details.
func (*Step) MarshalJSON ¶
func (Step) MarshalYAML ¶
func (*Step) UnmarshalJSON ¶
func (*Step) UnmarshalYAML ¶
type Workflow ¶
type WorkflowHook ¶
WorkflowHook represents a single action/command to perform. In YAML, it can be set as A map for a custom run commands:
- run: my custom command
func (*WorkflowHook) MarshalJSON ¶
func (s *WorkflowHook) MarshalJSON() ([]byte, error)
func (WorkflowHook) MarshalYAML ¶
func (s WorkflowHook) MarshalYAML() (interface{}, error)
func (WorkflowHook) ToValid ¶
func (s WorkflowHook) ToValid() *valid.WorkflowHook
func (*WorkflowHook) UnmarshalJSON ¶
func (s *WorkflowHook) UnmarshalJSON(data []byte) error
func (*WorkflowHook) UnmarshalYAML ¶
func (s *WorkflowHook) UnmarshalYAML(unmarshal func(interface{}) error) error
func (WorkflowHook) Validate ¶
func (s WorkflowHook) Validate() error