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 DefaultAutoDiscover() *valid.AutoDiscover
- func DefaultAutoPlan() valid.Autoplan
- func VersionValidator(value interface{}) error
- type AutoDiscover
- type Autoplan
- type GlobalCfg
- type Metrics
- type PolicyOwners
- type PolicySet
- type PolicySets
- type Project
- type Prometheus
- type Repo
- type RepoCfg
- type RepoLocks
- type Stage
- type Statsd
- type Step
- type TeamAuthz
- 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" ApprovedRequirement = "approved" MergeableRequirement = "mergeable" UnDivergedRequirement = "undiverged" )
const ( ExtraArgsKey = "extra_args" NameArgKey = "name" CommandArgKey = "command" ValueArgKey = "value" OutputArgKey = "output" RunStepName = "run" PlanStepName = "plan" ShowStepName = "show" PolicyCheckStepName = "policy_check" ApplyStepName = "apply" InitStepName = "init" EnvStepName = "env" MultiEnvStepName = "multienv" ImportStepName = "import" StateRmStepName = "state_rm" ShellArgKey = "shell" ShellArgsArgKey = "shellArgs" )
const DefaultAbortOnExcecutionOrderFail = false
DefaultAbortOnExcecutionOrderFail being false is the default setting for abort on execution group failiures
const DefaultEmojiReaction = ""
DefaultEmojiReaction is the default emoji reaction for repos
Variables ¶
var DefaultAutoDiscoverMode = valid.AutoDiscoverAutoMode
var DefaultAutoPlanWhenModified = []string{
"**/*.tf*",
"**/terragrunt.hcl",
"**/.terraform.lock.hcl",
}
DefaultAutoPlanWhenModified is the default element in the when_modified list if none is defined.
Functions ¶
func DefaultAutoDiscover ¶ added in v0.27.0
func DefaultAutoDiscover() *valid.AutoDiscover
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 AutoDiscover ¶ added in v0.27.0
type AutoDiscover struct {
Mode *valid.AutoDiscoverMode `yaml:"mode,omitempty"`
}
func (AutoDiscover) ToValid ¶ added in v0.27.0
func (a AutoDiscover) ToValid() *valid.AutoDiscover
func (AutoDiscover) Validate ¶ added in v0.27.0
func (a AutoDiscover) Validate() error
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"` TeamAuthz TeamAuthz `yaml:"team_authz" json:"team_authz"` }
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"` Teams []string `yaml:"teams,omitempty" json:"teams,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"` ApproveCount int `yaml:"approve_count,omitempty" json:"approve_count,omitempty"` PreventSelfApprove bool `yaml:"prevent_self_approve,omitempty" json:"prevent_self_approve,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"` ApproveCount int `yaml:"approve_count,omitempty" json:"approve_count,omitempty"` }
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"` Branch *string `yaml:"branch,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"` PlanRequirements []string `yaml:"plan_requirements,omitempty"` ApplyRequirements []string `yaml:"apply_requirements,omitempty"` ImportRequirements []string `yaml:"import_requirements,omitempty"` DependsOn []string `yaml:"depends_on,omitempty"` DeleteSourceBranchOnMerge *bool `yaml:"delete_source_branch_on_merge,omitempty"` RepoLocking *bool `yaml:"repo_locking,omitempty"` RepoLocks *RepoLocks `yaml:"repo_locks,omitempty"` ExecutionOrderGroup *int `yaml:"execution_order_group,omitempty"` PolicyCheck *bool `yaml:"policy_check,omitempty"` CustomPolicyCheck *bool `yaml:"custom_policy_check,omitempty"` SilencePRComments []string `yaml:"silence_pr_comments,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"` RepoConfigFile string `yaml:"repo_config_file" json:"repo_config_file"` PlanRequirements []string `yaml:"plan_requirements" json:"plan_requirements"` ApplyRequirements []string `yaml:"apply_requirements" json:"apply_requirements"` ImportRequirements []string `yaml:"import_requirements" json:"import_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"` RepoLocking *bool `yaml:"repo_locking,omitempty" json:"repo_locking,omitempty"` RepoLocks *RepoLocks `yaml:"repo_locks,omitempty" json:"repo_locks,omitempty"` PolicyCheck *bool `yaml:"policy_check,omitempty" json:"policy_check,omitempty"` CustomPolicyCheck *bool `yaml:"custom_policy_check,omitempty" json:"custom_policy_check,omitempty"` AutoDiscover *AutoDiscover `yaml:"autodiscover,omitempty" json:"autodiscover,omitempty"` SilencePRComments []string `yaml:"silence_pr_comments,omitempty" json:"silence_pr_comments,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"` AutoDiscover *AutoDiscover `yaml:"autodiscover,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"` EmojiReaction *string `yaml:"emoji_reaction,omitempty"` AllowedRegexpPrefixes []string `yaml:"allowed_regexp_prefixes,omitempty"` AbortOnExcecutionOrderFail *bool `yaml:"abort_on_execution_order_fail,omitempty"` RepoLocks *RepoLocks `yaml:"repo_locks,omitempty"` SilencePRComments []string `yaml:"silence_pr_comments,omitempty"` }
RepoCfg is the raw schema for repo-level atlantis.yaml config.
type RepoLocks ¶ added in v0.28.0
type RepoLocks struct {
Mode *valid.RepoLocksMode `yaml:"mode,omitempty"`
}
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 // StringVal will be set in case #4 above. StringVal map[string]string // Map will be set in case #3 above. Map map[string]map[string][]string // CommandMap will be set in case #2 above. CommandMap map[string]map[string]interface{} }
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, or a run step with a command and output config
- env: name: test_command command: echo 312
- env: name: test_value value: value
- env: name: test_bash_command command: echo ${test_value::7} shell: bash shellArgs: ["--verbose", "-c"]
- multienv: command: envs.sh output: hide shell: sh shellArgs: -c
- run: command: my custom command output: hide
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 TeamAuthz ¶ added in v0.30.0
type Workflow ¶
type Workflow struct { Apply *Stage `yaml:"apply,omitempty" json:"apply,omitempty"` Plan *Stage `yaml:"plan,omitempty" json:"plan,omitempty"` PolicyCheck *Stage `yaml:"policy_check,omitempty" json:"policy_check,omitempty"` Import *Stage `yaml:"import,omitempty" json:"import,omitempty"` StateRm *Stage `yaml:"state_rm,omitempty" json:"state_rm,omitempty"` }
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