Documentation
¶
Index ¶
- Variables
- func CreateCommandFromScript(ctx context.Context, script string) (*exec.Cmd, error)
- func DetectDefaultInterpreter() (string, []string)
- func DetectInterpreterFromShebang(script string) (string, []string)
- func JQ(ctx context.Context, path string, script string) (string, error)
- func TrimLine(lines string, prefix string) string
- func YQ(ctx context.Context, path string, script string) (string, error)
- type Artifact
- type Checkout
- type CheckoutMode
- type Dirty
- type Exec
- type ExecDetails
- type Setup
- type SetupResult
- type StashMode
- type Worktree
- type WorktreeMode
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultInterpreter string
View Source
var DefaultInterpreterArgs []string
Functions ¶
func CreateCommandFromScript ¶
CreateCommandFromScript creates an os/exec.Cmd from the script, using the interpreter specified in the shebang line if present.
func DetectDefaultInterpreter ¶
DetectDefaultInterpreter detects the default interpreter based on the OS.
func DetectInterpreterFromShebang ¶
DetectInterpreterFromShebang reads the first line of the script to detect the interpreter from the shebang line.
Types ¶
type Artifact ¶
type Artifact struct {
Path string `json:"path" yaml:"path" template:"true"`
Content io.ReadCloser `json:"-" yaml:"-"`
}
+kubebuilder:object:generate=true
func (*Artifact) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Artifact.
func (*Artifact) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Checkout ¶ added in v0.1.13
type Checkout struct {
Mode CheckoutMode `json:"mode,omitempty" yaml:"mode,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Connection string `json:"connection,omitempty" yaml:"connection,omitempty"`
Ref string `json:"ref,omitempty" yaml:"ref,omitempty"`
Depth *int `json:"depth,omitempty" yaml:"depth,omitempty"`
Dirty *Dirty `json:"dirty,omitempty" yaml:"dirty,omitempty"`
Worktree *Worktree `json:"worktree,omitempty" yaml:"worktree,omitempty"`
}
type CheckoutMode ¶ added in v0.1.13
type CheckoutMode string
const ( CheckoutNone CheckoutMode = "none" CheckoutLocal CheckoutMode = "local" CheckoutRemote CheckoutMode = "remote" )
type Exec ¶
type Exec struct {
Script string
Connections connection.ExecConnections
Checkout *connection.GitConnection
Artifacts []Artifact
EnvVars []types.EnvVar
DotEnv []string
Chroot string
BaseDir string
}
type ExecDetails ¶
type ExecDetails struct {
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
ExitCode int `json:"exitCode"`
Path string `json:"path"`
Args []string `json:"args"`
// Any extra details about the command execution, e.g. git commit id, etc.
Extra map[string]any `json:"extra,omitempty"`
Error error `json:"-" yaml:"-"`
Artifacts []Artifact `json:"-" yaml:"-"`
}
func (*ExecDetails) GetArtifacts ¶
func (e *ExecDetails) GetArtifacts() []Artifact
func (ExecDetails) String ¶
func (e ExecDetails) String() string
type Setup ¶ added in v0.1.13
type Setup struct {
Cwd string `json:"cwd,omitempty" yaml:"cwd,omitempty"`
BaseDir string `json:"baseDir,omitempty" yaml:"baseDir,omitempty"`
DotEnv []string `json:"dotenv,omitempty" yaml:"dotenv,omitempty"`
EnvVars []types.EnvVar `json:"envVars,omitempty" yaml:"envVars,omitempty"`
Checkout *Checkout `json:"checkout,omitempty" yaml:"checkout,omitempty"`
Connections connection.ExecConnections `json:"connections,omitempty" yaml:"connections,omitempty"`
Env []string `json:"-" yaml:"-"`
}
type SetupResult ¶ added in v0.1.13
type SetupResult struct {
Env []string
Cwd string
Extra map[string]any
Artifacts []Artifact
Cleanup func() error
}
type Worktree ¶ added in v0.1.13
type Worktree struct {
Mode WorktreeMode `json:"mode,omitempty" yaml:"mode,omitempty"`
Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
Base string `json:"base,omitempty" yaml:"base,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Keep bool `json:"keep,omitempty" yaml:"keep,omitempty"`
}
type WorktreeMode ¶ added in v0.1.13
type WorktreeMode string
const ( WorktreeNone WorktreeMode = "none" WorktreeNew WorktreeMode = "new" WorktreeExisting WorktreeMode = "existing" )
Click to show internal directories.
Click to hide internal directories.