config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParameterList = []Parameter{
	{
		Name:         "automerge",
		Description:  "Atlantis automerge config value.",
		Required:     false,
		DefaultValue: "true",
		Shorthand:    "",
	},
	{
		Name:         "parallel-apply",
		Description:  "Atlantis parallel apply config value.",
		Required:     false,
		DefaultValue: "true",
		Shorthand:    "",
	},
	{
		Name:         "parallel-plan",
		Description:  "Atlantis parallel plan config value.",
		Required:     false,
		DefaultValue: "true",
		Shorthand:    "",
	},
	{
		Name:         "terraform-base-dir",
		Description:  "Basedir for terraform resources.",
		Required:     false,
		DefaultValue: "./",
		Shorthand:    "",
	},
	{
		Name:         "output-file",
		Description:  "Atlantis YAML output file name.",
		Required:     false,
		DefaultValue: "atlantis.yaml",
		Shorthand:    "f",
	},
	{
		Name:         "output-type",
		Description:  "Atlantis YAML output type. [file|stdout].",
		Required:     false,
		DefaultValue: "file",
		Shorthand:    "e",
	},
	{
		Name:         "workflow",
		Description:  "Atlantis Workflow to be used. [single-workspace|multi-workspace].",
		Required:     true,
		DefaultValue: "",
		Shorthand:    "w",
	},
	{
		Name:         "when-modified",
		Description:  "Atlantis will trigger an autoplan when these modifications occur (list of strings).",
		Required:     false,
		DefaultValue: "**/*.tf,**/*.tfvars,**/*.json,**/*.tpl,**/*.tmpl,**/*.xml",
		Shorthand:    "m",
	},
	{
		Name:         "excluded-projects",
		Description:  "Atlantis regex filter to exclude projects.",
		Required:     false,
		DefaultValue: "",
		Shorthand:    "x",
	},
	{
		Name:         "included-projects",
		Description:  "Atlantis regex filter to only include projects.",
		Required:     false,
		DefaultValue: "",
		Shorthand:    "z",
	},
	{
		Name:         "pattern-detector",
		Description:  "discover projects based on files or directories names.",
		Required:     true,
		DefaultValue: "",
		Shorthand:    "q",
	},
	{
		Name:         "pull-num",
		Description:  "Github Pull Request Number to check diffs.",
		Required:     false,
		DefaultValue: "",
		Shorthand:    "p",
	},
	{
		Name:         "base-repo-name",
		Description:  "Github Repo Name.",
		Required:     false,
		DefaultValue: "",
		Shorthand:    "r",
	},
	{
		Name:         "base-repo-owner",
		Description:  "Github Repo Owner Name.",
		Required:     false,
		DefaultValue: "",
		Shorthand:    "o",
	},
	{
		Name:         "gh-token",
		Description:  "Specify the GitHub token when automatic detection is not possible.",
		Required:     false,
		DefaultValue: "",
		Shorthand:    "t",
	},
	{
		Name:        "pr-filter",
		Description: "Filter projects based on the PR changes (Only for github SCM).",
		Required:    false,
		Dependencies: DependentParameters{
			WhenParentParameterIs: "true",
			ParameterList:         []string{"pull-num", "base-repo-name", "base-repo-owner", "gh-token"}},
		DefaultValue: "false",
		Shorthand:    "u",
	},
}

ParameterList is the source of truth list for all parameters

Functions

func CheckRequiredParameters

func CheckRequiredParameters(parameterList []Parameter) error

func GenerateDescription

func GenerateDescription(param string, description string) (updatedDescription string)

GenerateDescription generates the description for a parameter

func Init

func Init(ccmd *cobra.Command) (err error)

Init generates the config Parameters object and checks for missing required parameters

Types

type Config

type Config struct {
	Parameters map[string]string
}
var GlobalConfig Config

type DependentParameters

type DependentParameters struct {
	WhenParentParameterIs string
	ParameterList         []string
}

type Parameter

type Parameter struct {
	Name         string
	Description  string
	Required     bool
	Dependencies DependentParameters
	DefaultValue string
	Shorthand    string
	Value        string
}

Jump to

Keyboard shortcuts

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