hooks

package
v1.206.3-test.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCIHooks

func RunCIHooks(event HookEvent, atmosConfig *schema.AtmosConfiguration, info *schema.ConfigAndStacksInfo, output string, forceCIMode bool, cmdErr error) error

RunCIHooks executes CI actions based on provider bindings. This is called automatically during command execution if CI is enabled. The output parameter is the command output to process (e.g., terraform plan output). The forceCIMode parameter forces CI mode even when environment detection fails (--ci flag). The cmdErr parameter is the error from the command execution (nil on success).

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 (
	BeforeTerraformInit  HookEvent = "before.terraform.init"
	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) 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

type TerraformOutputGetter added in v1.194.0

type TerraformOutputGetter func(
	atmosConfig *schema.AtmosConfiguration,
	stack string,
	component string,
	output string,
	skipCache bool,
	authContext *schema.AuthContext,
	authManager any,
) (any, bool, error)

TerraformOutputGetter retrieves terraform outputs. This enables dependency injection for testing. Returns:

  • value: The output value (may be nil if the output exists but has a null value)
  • exists: Whether the output key exists in the terraform outputs
  • error: Any error that occurred during retrieval (SDK errors, network issues, etc.)

Jump to

Keyboard shortcuts

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