raw

package
v0.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

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

View Source
const (
	DefaultWorkspace          = "default"
	ApprovedApplyRequirement  = "approved"
	MergeableApplyRequirement = "mergeable"
)
View Source
const (
	ExtraArgsKey  = "extra_args"
	NameArgKey    = "name"
	CommandArgKey = "command"
	ValueArgKey   = "value"
	RunStepName   = "run"
	PlanStepName  = "plan"
	ApplyStepName = "apply"
	InitStepName  = "init"
	EnvStepName   = "env"
)
View Source
const DefaultAutomerge = false

DefaultAutomerge is the default setting for automerge.

View Source
const DefaultParallelApply = false

DefaultParallelApply is the default setting for parallel apply

View Source
const DefaultParallelPlan = false

DefaultParallelPlan is the default setting for parallel plan

Variables

View Source
var DefaultAutoPlanWhenModified = []string{"**/*.tf*", "**/terragrunt.hcl"}

DefaultAutoPlanWhenModified is the default element in the when_modified list if none is defined.

Functions

func DefaultAutoPlan

func DefaultAutoPlan() valid.Autoplan

DefaultAutoPlan returns the default autoplan config.

Types

type Autoplan

type Autoplan struct {
	WhenModified []string `yaml:"when_modified,omitempty"`
	Enabled      *bool    `yaml:"enabled,omitempty"`
}

func (Autoplan) ToValid

func (a Autoplan) ToValid() valid.Autoplan

func (Autoplan) Validate

func (a Autoplan) Validate() error

type GlobalCfg added in v0.7.0

type GlobalCfg struct {
	Repos     []Repo              `yaml:"repos" json:"repos"`
	Workflows map[string]Workflow `yaml:"workflows" json:"workflows"`
}

GlobalCfg is the raw schema for server-side repo config.

func (GlobalCfg) ToValid added in v0.7.0

func (g GlobalCfg) ToValid(defaultCfg valid.GlobalCfg) valid.GlobalCfg

func (GlobalCfg) Validate added in v0.7.0

func (g GlobalCfg) Validate() error

type PreWorkflowHook added in v0.16.0

type PreWorkflowHook struct {
	StringVal map[string]string
}

PreWorkflowHook 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 (*PreWorkflowHook) MarshalJSON added in v0.16.0

func (s *PreWorkflowHook) MarshalJSON() ([]byte, error)

func (PreWorkflowHook) MarshalYAML added in v0.16.0

func (s PreWorkflowHook) MarshalYAML() (interface{}, error)

func (PreWorkflowHook) ToValid added in v0.16.0

func (s PreWorkflowHook) ToValid() *valid.PreWorkflowHook

func (*PreWorkflowHook) UnmarshalJSON added in v0.16.0

func (s *PreWorkflowHook) UnmarshalJSON(data []byte) error

func (*PreWorkflowHook) UnmarshalYAML added in v0.16.0

func (s *PreWorkflowHook) UnmarshalYAML(unmarshal func(interface{}) error) error

func (PreWorkflowHook) Validate added in v0.16.0

func (s PreWorkflowHook) 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"`
}

func (Project) ToValid

func (p Project) ToValid() valid.Project

func (Project) Validate

func (p Project) Validate() error

type Repo added in v0.7.0

type Repo struct {
	ID                   string            `yaml:"id" json:"id"`
	ApplyRequirements    []string          `yaml:"apply_requirements" json:"apply_requirements"`
	PreWorkflowHooks     []PreWorkflowHook `yaml:"pre_workflow_hooks" json:"pre_workflow_hooks"`
	Workflow             *string           `yaml:"workflow,omitempty" json:"workflow,omitempty"`
	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"`
}

Repo is the raw schema for repos in the server-side repo config.

func (Repo) HasRegexID added in v0.7.0

func (r Repo) HasRegexID() bool

HasRegexID returns true if r is configured with a regex id instead of an exact match id.

func (Repo) ToValid added in v0.7.0

func (r Repo) ToValid(workflows map[string]valid.Workflow) valid.Repo

func (Repo) Validate added in v0.7.0

func (r Repo) Validate() error

type RepoCfg added in v0.7.0

type RepoCfg struct {
	Version       *int                `yaml:"version,omitempty"`
	Projects      []Project           `yaml:"projects,omitempty"`
	Workflows     map[string]Workflow `yaml:"workflows,omitempty"`
	Automerge     *bool               `yaml:"automerge,omitempty"`
	ParallelApply *bool               `yaml:"parallel_apply,omitempty"`
	ParallelPlan  *bool               `yaml:"parallel_plan,omitempty"`
}

RepoCfg is the raw schema for repo-level atlantis.yaml config.

func (RepoCfg) ToValid added in v0.7.0

func (r RepoCfg) ToValid() valid.RepoCfg

func (RepoCfg) Validate added in v0.7.0

func (r RepoCfg) Validate() error

type Stage

type Stage struct {
	Steps []Step `yaml:"steps,omitempty" json:"steps,omitempty"`
}

func (Stage) ToValid

func (s Stage) ToValid() valid.Stage

func (Stage) Validate

func (s Stage) Validate() error

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

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 added in v0.12.0

func (s *Step) MarshalJSON() ([]byte, error)

func (Step) MarshalYAML added in v0.12.0

func (s Step) MarshalYAML() (interface{}, error)

func (Step) ToValid

func (s Step) ToValid() valid.Step

func (*Step) UnmarshalJSON added in v0.7.0

func (s *Step) UnmarshalJSON(data []byte) error

func (*Step) UnmarshalYAML

func (s *Step) UnmarshalYAML(unmarshal func(interface{}) error) error

func (Step) Validate

func (s Step) Validate() error

type Workflow

type Workflow struct {
	Apply *Stage `yaml:"apply,omitempty" json:"apply,omitempty"`
	Plan  *Stage `yaml:"plan,omitempty" json:"plan,omitempty"`
}

func (Workflow) ToValid

func (w Workflow) ToValid(name string) valid.Workflow

func (Workflow) Validate

func (w Workflow) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL