cmds

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cmds contains logic for interacting with command line and environment variables

Index

Constants

View Source
const (
	DevImageRegistry = "devenv.local"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdWrapper

type CmdWrapper struct {

	// Path where to execute command
	Path string
	// contains filtered or unexported fields
}

CmdWrapper contains data required for cmd interaction

func NewCmdWrapper

func NewCmdWrapper(b *box.Config, log logrus.FieldLogger,
	rconf *kubernetesruntime.RuntimeConfig,
	path string) *CmdWrapper

NewCmdWrapper creates new CmdWrapper

func (*CmdWrapper) DevspaceCommand

func (c *CmdWrapper) DevspaceCommand(ctx context.Context, opts *CommandBuilderOptions, vars []string,
	repositoryName string, setNamespace bool) (*exec.Cmd, error)

DevspaceCommand returns the exec.Cmd to run the devspace command

func (*CmdWrapper) EnsureDevspace

func (c *CmdWrapper) EnsureDevspace() (string, error)

EnsureDevspace ensures that devspace exists and returns the location of devspace binary. Note: this outputs text if devspace is being downloaded

func (*CmdWrapper) GetEnvVars

func (c *CmdWrapper) GetEnvVars(local bool, version, repositoryName string) ([]string, error)

GetEnvVars returns the environment variables that should be set for the deploy/dev commands

func (*CmdWrapper) GetLegacyOverridesEnvVars

func (c *CmdWrapper) GetLegacyOverridesEnvVars() []string

GetLegacyOverridesEnvVars returns the environment variables that should be set for legacy (pre-devspace) commands

func (*CmdWrapper) OverrideCommand

func (c *CmdWrapper) OverrideCommand(ctx context.Context, opts *CommandBuilderOptions, vars []string) (*exec.Cmd, error)

OverrideCommand returns the exec.Cmd to run the override script

type CommandBuilderOptions

type CommandBuilderOptions struct {
	EnvironmentVariabes []string

	// this config top level key has to be defined in devspace.yaml
	RequiredConfig string

	// args to pass to the devspace command
	DevspaceArgs []string

	// If one of these exists, we don't invoke devspace.
	FallbackCommandPaths []string

	// args to pass to the fallback command
	FallbackCommandArgs []string
}

CommandBuilderOptions contains options for creating exec.Cmd to run either a devspace or fallback command

Jump to

Keyboard shortcuts

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