hooks

package
v1.160.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	GetName() string
	RunE(hook *Hook, event HookEvent, cmd *cobra.Command, args []string) error
}

Command is the interface for all commands that can be run by hooks

type Hook

type Hook struct {
	Events  []string `yaml:"events"`
	Command string   `yaml:"command"`

	// store command
	Name    string            `yaml:"name,omitempty"`    // for store command
	Outputs map[string]string `yaml:"outputs,omitempty"` // for store command
}

Hook is the structure for a hook and is using in the stack config to define a command that should be run when a specific event occurs.

type HookEvent added in v1.159.0

type HookEvent string
const (
	AfterTerraformApply  HookEvent = "after.terraform.apply"
	BeforeTerraformApply HookEvent = "before.terraform.apply"
	AfterTerraformPlan   HookEvent = "after.terraform.plan"
	BeforeTerraformPlan  HookEvent = "before.terraform.plan"
)

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

func GetHooks added in v1.159.0

func GetHooks(atmosConfig *schema.AtmosConfiguration, info *schema.ConfigAndStacksInfo) (*Hooks, error)

func (Hooks) ConvertToHooks added in v1.140.0

func (h Hooks) ConvertToHooks(input map[string]any) (Hooks, error)

func (Hooks) HasHooks added in v1.159.0

func (h Hooks) HasHooks() bool

func (Hooks) RunAll added in v1.159.0

func (h Hooks) RunAll(event HookEvent, atmosConfig *schema.AtmosConfiguration, info *schema.ConfigAndStacksInfo, cmd *cobra.Command, args []string) error

type StoreCommand added in v1.159.0

type StoreCommand struct {
	Name string
	// contains filtered or unexported fields
}

func NewStoreCommand added in v1.159.0

func NewStoreCommand(atmosConfig *schema.AtmosConfiguration, info *schema.ConfigAndStacksInfo) (*StoreCommand, error)

func (*StoreCommand) GetName added in v1.159.0

func (c *StoreCommand) GetName() string

func (*StoreCommand) RunE added in v1.159.0

func (c *StoreCommand) RunE(hook *Hook, event HookEvent, cmd *cobra.Command, args []string) error

RunE is the entrypoint for the store command

Jump to

Keyboard shortcuts

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