deploy

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "deploy"

Type is the string value of the RawTarget type

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Target      *Target
	Artifact    *Artifact
	K8sClient   kube.Client
	Broker      cqrs.Broker
	ManifestDir string
	Logger      logz.FieldLogger
}

Action is the executor for deploying a manifest

func (Action) Execute

func (a Action) Execute(ctx context.Context) error

Execute runs the action and produces a deploy.Artifact

func (*Action) UseBroker

func (a *Action) UseBroker(client cqrs.Broker)

UseBroker injects the broker into the Action

func (*Action) UseK8sClient

func (a *Action) UseK8sClient(client kube.Client)

UseK8sClient injects the Kubernetes client into the Action

func (*Action) UseLogger

func (a *Action) UseLogger(logger logz.FieldLogger)

UseLogger injects a logger into the target's action

type Artifact

type Artifact struct {
	ark.RawArtifact `mapstructure:",squash"`
}

Artifact is the result of a successful actions.Deploy

func (Artifact) Cacheable

func (a Artifact) Cacheable() bool

Cacheable always returns false because a deploy target should be apply-able at all times

func (Artifact) LocallyCached

func (a Artifact) LocallyCached(_ context.Context) (bool, error)

LocallyCached always returns false because the target is not cacheable

func (Artifact) Pull

func (a Artifact) Pull(_ context.Context) error

Pull does not do anything

func (Artifact) Push

func (a Artifact) Push(_ context.Context) error

Push does not do anything

func (Artifact) RemotelyCached

func (a Artifact) RemotelyCached(_ context.Context) (bool, error)

RemotelyCached always returns false because the target is not cacheable

type Step

type Step struct {
	Command  []string `mapstructure:"manifest" json:"manifest"`
	WorkDir  string   `mapstructure:"workDir"  json:"workDir"`
	Patterns []string `mapstructure:"patterns" json:"patterns"`
}

Step defines the required fields to execute one or more commands when a changed file matches a given pattern

type Target

type Target struct {
	ark.RawTarget       `mapstructure:",squash"`
	Manifest            string              `mapstructure:"manifest"            json:"manifest"`
	PortForward         portbinder.PortMap  `mapstructure:"portForward"         json:"portForward"` // TODO: There's no input validation for this in this code
	LiveSyncEnabled     bool                `mapstructure:"liveSyncEnabled"     json:"liveSyncEnabled"`
	LiveSyncRestartMode string              `mapstructure:"liveSyncRestartMode" json:"liveSyncRestartMode"` // TODO: There's no input validation for this code or setting of a default
	LiveSyncOnStep      []Step              `mapstructure:"liveSyncOnStep"      json:"liveSyncOnStep"`
	Env                 []map[string]string `mapstructure:"env"                 json:"env"`
}

Target expresses an intention to construct a deployable manifest

func (Target) Produce

func (t Target) Produce(checksum hash.Hash) (ark.Artifact, error)

Produce should produce a deterministic manifest artifact

func (*Target) Validate

func (t *Target) Validate() error

Validate checks if the RawTarget fields are valid

Jump to

Keyboard shortcuts

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