exec

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAtlantisProjectName added in v1.30.0

func BuildAtlantisProjectName(context schema.Context, projectNameTemplate string) string

BuildAtlantisProjectName builds an Atlantis project name from the provided context and project name pattern

func BuildAtlantisProjectNameFromComponentConfig added in v1.31.0

func BuildAtlantisProjectNameFromComponentConfig(
	cliConfig schema.CliConfiguration,
	componentName string,
	componentSettingsSection map[any]any,
	componentVarsSection map[any]any,
) (string, error)

BuildAtlantisProjectNameFromComponentConfig builds an Atlantis project name from the component config

func BuildComponentPath added in v1.31.0

func BuildComponentPath(
	cliConfig schema.CliConfiguration,
	componentSectionMap map[string]any,
	componentType string,
) string

BuildComponentPath builds component path (path to the component's physical location on disk)

func BuildDependentStackNameFromDependsOn added in v1.33.2

func BuildDependentStackNameFromDependsOn(
	dependsOn string,
	allStackNames []string,
	currentStackName string,
	componentNamesInCurrentStack []string,
	currentComponentName string,
) (string, error)

BuildDependentStackNameFromDependsOn builds the dependent stack name from "depends_on" attribute

func BuildSpaceliftStackName added in v1.24.0

func BuildSpaceliftStackName(spaceliftSettings map[any]any, context schema.Context, contextPrefix string) (string, string)

BuildSpaceliftStackName builds a Spacelift stack name from the provided context and stack name pattern

func BuildSpaceliftStackNameFromComponentConfig added in v1.31.0

func BuildSpaceliftStackNameFromComponentConfig(
	cliConfig schema.CliConfiguration,
	componentName string,
	stackName string,
	componentSettingsSection map[any]any,
	componentVarsSection map[any]any,
) (string, error)

BuildSpaceliftStackNameFromComponentConfig builds Spacelift stack name from the component config

func BuildSpaceliftStackNames added in v1.31.0

func BuildSpaceliftStackNames(stacks map[string]any, stackNamePattern string) ([]string, error)

BuildSpaceliftStackNames builds Spacelift stack names

func BuildTerraformWorkspace added in v1.4.8

func BuildTerraformWorkspace(
	stack string,
	stackNamePattern string,
	componentMetadata map[any]any,
	context schema.Context,
) (string, error)

BuildTerraformWorkspace builds Terraform workspace

func ExecuteAtlantisGenerateRepoConfig added in v1.5.0

func ExecuteAtlantisGenerateRepoConfig(
	cliConfig schema.CliConfiguration,
	outputPath string,
	configTemplateNameArg string,
	projectTemplateNameArg string,
	stacks []string,
	components []string,
) error

ExecuteAtlantisGenerateRepoConfig generates repository configuration for Atlantis

func ExecuteAtlantisGenerateRepoConfigAffectedOnly added in v1.30.0

func ExecuteAtlantisGenerateRepoConfigAffectedOnly(
	cliConfig schema.CliConfiguration,
	outputPath string,
	configTemplateName string,
	projectTemplateName string,
	ref string,
	sha string,
	repoPath string,
	sshKeyPath string,
	sshKeyPassword string,
	verbose bool,
) error

ExecuteAtlantisGenerateRepoConfigAffectedOnly generates repository configuration for Atlantis only for the affected compoenents and stacks

func ExecuteAtlantisGenerateRepoConfigCmd added in v1.5.0

func ExecuteAtlantisGenerateRepoConfigCmd(cmd *cobra.Command, args []string) error

ExecuteAtlantisGenerateRepoConfigCmd executes 'atlantis generate repo-config' command

func ExecuteAtmosVendorInternal added in v1.47.0

func ExecuteAtmosVendorInternal(
	cliConfig schema.CliConfiguration,
	vendorConfigFileName string,
	atmosVendorSpec schema.AtmosVendorSpec,
	component string,
	dryRun bool,
) error

ExecuteAtmosVendorInternal downloads the artifacts from the sources and writes them to the targets

func ExecuteAwsEksUpdateKubeconfig added in v1.4.9

func ExecuteAwsEksUpdateKubeconfig(kubeconfigContext schema.AwsEksUpdateKubeconfigContext) error

ExecuteAwsEksUpdateKubeconfig executes 'aws eks update-kubeconfig' https://docs.aws.amazon.com/cli/latest/reference/eks/update-kubeconfig.html

func ExecuteAwsEksUpdateKubeconfigCommand added in v1.4.9

func ExecuteAwsEksUpdateKubeconfigCommand(cmd *cobra.Command, args []string) error

func ExecuteComponentVendorInternal added in v1.47.0

func ExecuteComponentVendorInternal(
	cliConfig schema.CliConfiguration,
	vendorComponentSpec schema.VendorComponentSpec,
	component string,
	componentPath string,
	dryRun bool,
) error

ExecuteComponentVendorInternal executes the 'atmos vendor pull' command for a component Supports all protocols (local files, Git, Mercurial, HTTP, HTTPS, Amazon S3, Google GCP), URL and archive formats described in https://github.com/hashicorp/go-getter https://www.allee.xyz/en/posts/getting-started-with-go-getter https://github.com/otiai10/copy https://opencontainers.org/ https://github.com/google/go-containerregistry https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html

func ExecuteDescribeAffectedCmd added in v1.17.0

func ExecuteDescribeAffectedCmd(cmd *cobra.Command, args []string) error

ExecuteDescribeAffectedCmd executes `describe affected` command

func ExecuteDescribeAffectedWithTargetRepoClone added in v1.26.0

func ExecuteDescribeAffectedWithTargetRepoClone(
	cliConfig schema.CliConfiguration,
	ref string,
	sha string,
	sshKeyPath string,
	sshKeyPassword string,
	verbose bool,
	includeSpaceliftAdminStacks bool,
) ([]schema.Affected, error)

ExecuteDescribeAffectedWithTargetRepoClone clones the remote repo using `ref` or `sha`, and processes stack configs and returns a list of the affected Atmos components and stacks given two Git commits

func ExecuteDescribeAffectedWithTargetRepoPath added in v1.26.0

func ExecuteDescribeAffectedWithTargetRepoPath(
	cliConfig schema.CliConfiguration,
	repoPath string,
	verbose bool,
	includeSpaceliftAdminStacks bool,
) ([]schema.Affected, error)

ExecuteDescribeAffectedWithTargetRepoPath uses `repo-path` to access the target repo, and processes stack configs and returns a list of the affected Atmos components and stacks given two Git commits

func ExecuteDescribeComponent

func ExecuteDescribeComponent(component string, stack string) (map[string]any, error)

ExecuteDescribeComponent describes component config

func ExecuteDescribeComponentCmd added in v1.11.0

func ExecuteDescribeComponentCmd(cmd *cobra.Command, args []string) error

ExecuteDescribeComponentCmd executes `describe component` command

func ExecuteDescribeConfigCmd added in v1.11.0

func ExecuteDescribeConfigCmd(cmd *cobra.Command, args []string) error

ExecuteDescribeConfigCmd executes `describe config` command

func ExecuteDescribeDependents added in v1.33.2

func ExecuteDescribeDependents(
	cliConfig schema.CliConfiguration,
	component string,
	stack string,
) ([]schema.Dependent, error)

ExecuteDescribeDependents produces a list of Atmos components in Atmos stacks that depend on the provided Atmos component

func ExecuteDescribeDependentsCmd added in v1.33.2

func ExecuteDescribeDependentsCmd(cmd *cobra.Command, args []string) error

ExecuteDescribeDependentsCmd executes `describe dependents` command

func ExecuteDescribeStacks added in v1.4.4

func ExecuteDescribeStacks(
	cliConfig schema.CliConfiguration,
	filterByStack string,
	components []string,
	componentTypes []string,
	sections []string,
	ignoreMissingFiles bool,
) (map[string]any, error)

ExecuteDescribeStacks processes stack manifests and returns the final map of stacks and components

func ExecuteDescribeStacksCmd added in v1.11.0

func ExecuteDescribeStacksCmd(cmd *cobra.Command, args []string) error

ExecuteDescribeStacksCmd executes `describe stacks` command

func ExecuteHelmfile

func ExecuteHelmfile(info schema.ConfigAndStacksInfo) error

ExecuteHelmfile executes helmfile commands

func ExecuteHelmfileCmd added in v1.11.0

func ExecuteHelmfileCmd(cmd *cobra.Command, args []string) error

ExecuteHelmfileCmd parses the provided arguments and flags and executes helmfile commands

func ExecuteHelmfileGenerateVarfileCmd added in v1.11.0

func ExecuteHelmfileGenerateVarfileCmd(cmd *cobra.Command, args []string) error

ExecuteHelmfileGenerateVarfileCmd executes `helmfile generate varfile` command

func ExecuteShell added in v1.16.0

func ExecuteShell(
	cliConfig schema.CliConfiguration,
	command string,
	name string,
	dir string,
	env []string,
	dryRun bool,
) error

ExecuteShell runs a shell script

func ExecuteShellAndReturnOutput added in v1.16.0

func ExecuteShellAndReturnOutput(
	cliConfig schema.CliConfiguration,
	command string,
	name string,
	dir string,
	env []string,
	dryRun bool,
) (string, error)

ExecuteShellAndReturnOutput runs a shell script and capture its standard output

func ExecuteShellCommand added in v1.4.9

func ExecuteShellCommand(
	cliConfig schema.CliConfiguration,
	command string,
	args []string,
	dir string,
	env []string,
	dryRun bool,
	redirectStdError string,
) error

ExecuteShellCommand prints and executes the provided command with args and flags

func ExecuteStackVendorInternal added in v1.47.0

func ExecuteStackVendorInternal(
	stack string,
	dryRun bool,
) error

ExecuteStackVendorInternal executes the command to vendor an Atmos stack TODO: implement this

func ExecuteTerraform

func ExecuteTerraform(info schema.ConfigAndStacksInfo) error

ExecuteTerraform executes terraform commands

func ExecuteTerraformCmd added in v1.11.0

func ExecuteTerraformCmd(cmd *cobra.Command, args []string) error

ExecuteTerraformCmd parses the provided arguments and flags and executes terraform commands

func ExecuteTerraformGenerateBackendCmd added in v1.11.0

func ExecuteTerraformGenerateBackendCmd(cmd *cobra.Command, args []string) error

ExecuteTerraformGenerateBackendCmd executes `terraform generate backend` command

func ExecuteTerraformGenerateBackends

func ExecuteTerraformGenerateBackends(cliConfig schema.CliConfiguration, fileTemplate string, format string, stacks []string, components []string) error

ExecuteTerraformGenerateBackends generates backend configs for all terraform components

func ExecuteTerraformGenerateBackendsCmd added in v1.7.0

func ExecuteTerraformGenerateBackendsCmd(cmd *cobra.Command, args []string) error

ExecuteTerraformGenerateBackendsCmd executes `terraform generate backends` command

func ExecuteTerraformGenerateVarfileCmd added in v1.11.0

func ExecuteTerraformGenerateVarfileCmd(cmd *cobra.Command, args []string) error

ExecuteTerraformGenerateVarfileCmd executes `terraform generate varfile` command

func ExecuteTerraformGenerateVarfiles added in v1.5.0

func ExecuteTerraformGenerateVarfiles(cliConfig schema.CliConfiguration, fileTemplate string, format string, stacks []string, components []string) error

ExecuteTerraformGenerateVarfiles generates varfiles for all terraform components in all stacks

func ExecuteTerraformGenerateVarfilesCmd added in v1.5.0

func ExecuteTerraformGenerateVarfilesCmd(cmd *cobra.Command, args []string) error

ExecuteTerraformGenerateVarfilesCmd executes `terraform generate varfiles` command

func ExecuteValidateComponent added in v1.9.0

func ExecuteValidateComponent(
	cliConfig schema.CliConfiguration,
	configAndStacksInfo schema.ConfigAndStacksInfo,
	componentName string,
	stack string,
	schemaPath string,
	schemaType string,
	modulePaths []string,
	timeoutSeconds int,
) (bool, error)

ExecuteValidateComponent validates a component in a stack using JsonSchema, OPA or CUE schema documents

func ExecuteValidateComponentCmd added in v1.9.0

func ExecuteValidateComponentCmd(cmd *cobra.Command, args []string) error

ExecuteValidateComponentCmd executes `validate component` command

func ExecuteValidateStacksCmd added in v1.11.0

func ExecuteValidateStacksCmd(cmd *cobra.Command, args []string) error

ExecuteValidateStacksCmd executes `validate stacks` command

func ExecuteVendorDiffCmd added in v1.11.0

func ExecuteVendorDiffCmd(cmd *cobra.Command, args []string) error

ExecuteVendorDiffCmd executes `vendor diff` commands

func ExecuteVendorPullCmd added in v1.11.0

func ExecuteVendorPullCmd(cmd *cobra.Command, args []string) error

ExecuteVendorPullCmd executes `vendor pull` commands

func ExecuteVendorPullCommand added in v1.47.0

func ExecuteVendorPullCommand(cmd *cobra.Command, args []string) error

ExecuteVendorPullCommand executes `atmos vendor` commands

func ExecuteWorkflow added in v1.4.0

func ExecuteWorkflow(
	cliConfig schema.CliConfiguration,
	workflow string,
	workflowPath string,
	workflowDefinition *schema.WorkflowDefinition,
	dryRun bool,
	commandLineStack string,
	fromStep string,
) error

ExecuteWorkflow executes an Atmos workflow

func ExecuteWorkflowCmd added in v1.11.0

func ExecuteWorkflowCmd(cmd *cobra.Command, args []string) error

ExecuteWorkflowCmd executes a workflow

func FindComponentConfig added in v1.3.28

func FindComponentConfig(
	configAndStacksInfo *schema.ConfigAndStacksInfo,
	stack string,
	stacksMap map[string]any,
	componentType string,
	component string,
) error

FindComponentConfig finds component config sections

func FindComponentDependencies added in v1.42.0

func FindComponentDependencies(currentStack string, sources schema.ConfigSources) ([]string, []string, error)

FindComponentDependencies finds all imports that the component depends on, and all imports that the component has any sections defind in

func FindStacksMap added in v1.4.4

func FindStacksMap(cliConfig schema.CliConfiguration, ignoreMissingFiles bool) (
	map[string]any,
	map[string]map[string]any,
	error,
)

FindStacksMap processes stack config and returns a map of all stacks

func FindValidationSection added in v1.9.0

func FindValidationSection(componentSection map[string]any) (schema.Validation, error)

FindValidationSection finds 'validation' section in the component config

func ProcessComponentMetadata added in v1.8.0

func ProcessComponentMetadata(
	component string,
	componentSection map[string]any,
) (map[any]any, string, bool)

ProcessComponentMetadata processes component metadata and returns a base component (if any) and whether the component is real or abstract

func ProcessConfigSources added in v1.42.0

func ProcessConfigSources(
	configAndStacksInfo schema.ConfigAndStacksInfo,
	rawStackConfigs map[string]map[string]any,
) (schema.ConfigSources, error)

ProcessConfigSources processes the sources (files) for all sections for a component in a stack

func ProcessStacks added in v1.3.28

func ProcessStacks(
	cliConfig schema.CliConfiguration,
	configAndStacksInfo schema.ConfigAndStacksInfo,
	checkStack bool,
) (schema.ConfigAndStacksInfo, error)

ProcessStacks processes stack config

func ReadAndProcessComponentVendorConfigFile added in v1.47.0

func ReadAndProcessComponentVendorConfigFile(
	cliConfig schema.CliConfiguration,
	component string,
	componentType string,
) (schema.VendorComponentConfig, string, error)

ReadAndProcessComponentVendorConfigFile reads and processes the component vendoring config file `component.yaml`

func ReadAndProcessVendorConfigFile added in v1.47.0

func ReadAndProcessVendorConfigFile(cliConfig schema.CliConfiguration, vendorConfigFile string) (
	schema.AtmosVendorConfig,
	bool,
	string,
	error,
)

ReadAndProcessVendorConfigFile reads and processes the Atmos vendoring config file `vendor.yaml`

func ValidateComponent added in v1.9.0

func ValidateComponent(
	cliConfig schema.CliConfiguration,
	componentName string,
	componentSection any,
	schemaPath string,
	schemaType string,
	modulePaths []string,
	timeoutSeconds int,
) (bool, error)

ValidateComponent validates the component config using JsonSchema, OPA or CUE schema documents

func ValidateWithCue added in v1.9.0

func ValidateWithCue(data any, schemaName string, schemaText string) (bool, error)

ValidateWithCue validates the data structure using the provided CUE document https://cuelang.org/docs/integrations/go/#processing-cue-in-go

func ValidateWithJsonSchema added in v1.9.0

func ValidateWithJsonSchema(data any, schemaName string, schemaText string) (bool, error)

ValidateWithJsonSchema validates the data structure using the provided JSON Schema document https://github.com/santhosh-tekuri/jsonschema https://go.dev/play/p/Hhax3MrtD8r

func ValidateWithOpa added in v1.9.0

func ValidateWithOpa(
	data any,
	schemaPath string,
	modulePaths []string,
	timeoutSeconds int,
) (bool, error)

ValidateWithOpa validates the data structure using the provided OPA document https://github.com/open-policy-agent/opa/blob/main/rego/example_test.go https://github.com/open-policy-agent/opa/blob/main/rego/rego_test.go https://www.openpolicyagent.org/docs/latest/integration/#sdk

func ValidateWithOpaLegacy added in v1.38.0

func ValidateWithOpaLegacy(
	data any,
	schemaName string,
	schemaText string,
	timeoutSeconds int,
) (bool, error)

ValidateWithOpaLegacy validates the data structure using the provided OPA document https://www.openpolicyagent.org/docs/latest/integration/#sdk

Types

This section is empty.

Jump to

Keyboard shortcuts

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