raw

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 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"
	RunStepName   = "run"
	PlanStepName  = "plan"
	ApplyStepName = "apply"
	InitStepName  = "init"
)
View Source
const DefaultAutoPlanWhenModified = "**/*.tf*"

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

View Source
const DefaultAutomerge = false

DefaultAutomerge is the default setting for automerge.

Variables

This section is empty.

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 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"`
	Workflow             *string  `yaml:"workflow,omitempty" json:"workflow,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"`
}

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
	// Map will be set in case #2 above.
	Map map[string]map[string][]string
	// StringVal will be set in case #3 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 a built-in command and extra_args:

  • plan: extra_args: [-var-file=staging.tfvars]

3. 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) 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