hooks

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupStaticEnvOptions

func SetupStaticEnvOptions(cfg Config)

Types

type BuildEnvOpts

type BuildEnvOpts struct {
	Image        string
	PushImage    bool
	ImageRepo    string
	ImageTag     string
	BuildContext string
}

BuildEnvOpts contains the environment variables to be set in a build type lifecycle hook executor.

func NewBuildEnvOpts added in v1.30.0

func NewBuildEnvOpts(a *v1.Artifact, image string, pushImage bool) (BuildEnvOpts, error)

NewBuildEnvOpts returns `BuildEnvOpts` required to create a `Runner` for build lifecycle hooks

type Config

type Config interface {
	DefaultRepo() *string
	GetWorkingDir() string
	RPCPort() int
	RPCHTTPPort() int
}

type DeployEnvOpts

type DeployEnvOpts struct {
	RunID       string
	KubeContext string
	Namespaces  string
}

DeployEnvOpts contains the environment variables to be set in a deploy type lifecycle hook executor.

func NewDeployEnvOpts added in v1.30.0

func NewDeployEnvOpts(runID string, kubeContext string, namespaces []string) DeployEnvOpts

type Runner added in v1.30.0

type Runner interface {
	// RunPreHooks executes all pre-step hooks defined by the `Runner`
	RunPreHooks(ctx context.Context, out io.Writer) error
	// RunPostHooks executes all post-step hooks defined by the `Runner`
	RunPostHooks(ctx context.Context, out io.Writer) error
}

Runner represents a lifecycle hooks runner

func BuildRunner added in v1.30.0

func BuildRunner(d v1.BuildHooks, opts BuildEnvOpts) Runner

BuildRunner creates a new runner for pre-build and post-build lifecycle hooks

func NewDeployRunner added in v1.30.0

func NewDeployRunner(cli *kubectl.CLI, d v1.DeployHooks, namespaces []string, formatter logger.Formatter, opts DeployEnvOpts) Runner

func NewSyncRunner added in v1.30.0

func NewSyncRunner(cli *kubectl.CLI, imageName, imageRef string, namespaces []string, formatter logger.Formatter, d v1.SyncHooks, opts SyncEnvOpts) Runner

type StaticEnvOpts

type StaticEnvOpts struct {
	DefaultRepo *string
	RPCPort     int
	HTTPPort    int
	WorkDir     string
}

StaticEnvOpts contains the environment variables to be set in a lifecycle hook executor that don't change during the lifetime of the process.

type SyncEnvOpts

type SyncEnvOpts struct {
	Image                string
	BuildContext         string
	FilesAddedOrModified *string
	FilesDeleted         *string
	KubeContext          string
	Namespaces           string
}

SyncEnvOpts contains the environment variables to be set in a sync type lifecycle hook executor.

func NewSyncEnvOpts added in v1.30.0

func NewSyncEnvOpts(a *v1.Artifact, image string, addOrModifyFiles []string, deleteFiles []string, namespaces []string, kubeContext string) (SyncEnvOpts, error)

Jump to

Keyboard shortcuts

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