Documentation
¶
Index ¶
- Variables
- func WithErrCtxLogAdditionalCtx(logAdditionalCtx bool) func(*ErrorCtx)
- func WithStepsCtxExportFile(exportFile *StepFile) func(*StepsContext)
- func WithStepsCtxOutputFile(outputFile *StepFile) func(*StepsContext)
- func WithStepsCtxStepResults(results map[string]*proto.StepResult) func(*StepsContext)
- type Describer
- type DynamicStepResource
- type Environment
- func GlobalEnvironment(parent *Environment, jobVars JobVariables) (*Environment, error)
- func NewEmptyEnvironment() *Environment
- func NewEnvironment(vars map[string]string) *Environment
- func NewEnvironmentFromOS(rejectIf ...func(string) bool) (*Environment, error)
- func NewEnvironmentFromOSWithKnownVars() (*Environment, error)
- func NewKVEnvironment(keyValues ...string) *Environment
- type ErrorCtx
- type ExecResult
- type ExecutableStep
- type FileSystemStepResource
- type FixedStepResource
- type FunctionDescriptor
- func (sd *FunctionDescriptor) DefinitionOutputs() map[string]*structpb.Value
- func (sd *FunctionDescriptor) DelegateTo() string
- func (sd *FunctionDescriptor) DescribeType() string
- func (sd *FunctionDescriptor) Dir() string
- func (sd *FunctionDescriptor) Env() map[string]string
- func (sd *FunctionDescriptor) ExecCommand() []string
- func (sd *FunctionDescriptor) ExecWorkDir() string
- func (sd *FunctionDescriptor) FunctionName() string
- func (sd *FunctionDescriptor) IsDelegateOutputs() bool
- func (sd *FunctionDescriptor) IsTypeExec() bool
- func (sd *FunctionDescriptor) IsTypeFunction() bool
- func (sd *FunctionDescriptor) IsTypeSteps() bool
- func (sd *FunctionDescriptor) SpecInputWithName(name string) (*proto.Spec_Content_Input, bool)
- func (sd *FunctionDescriptor) SpecInputs() map[string]*proto.Spec_Content_Input
- func (sd *FunctionDescriptor) SpecOutputs() map[string]*proto.Spec_Content_Output
- func (sd *FunctionDescriptor) Steps() []*proto.Step
- func (sd *FunctionDescriptor) ToProto() *proto.SpecDefinition
- type FunctionStepResource
- type GitStepResource
- type GlobalContext
- func (gc *GlobalContext) AddGlobalEnv(env *Environment)
- func (gc *GlobalContext) Env() *Environment
- func (gc *GlobalContext) EnvWithLexicalScope(envVars map[string]string) *Environment
- func (gc *GlobalContext) Job() JobVariables
- func (gc *GlobalContext) Logf(format string, v ...any) error
- func (gc *GlobalContext) Logln(format string, v ...any) error
- func (gc *GlobalContext) LookupEnv(key string) (string, bool)
- func (gc *GlobalContext) Pipe() (io.Writer, io.Writer)
- func (gc *GlobalContext) ProjectDir() string
- func (gc *GlobalContext) WorkDir() string
- type JobVariables
- type Kind
- type LazilyLoadedStep
- type NamedStepReference
- type Params
- type Parser
- type SequenceOfSteps
- type Step
- type StepFile
- func (s *StepFile) Path() string
- func (s *StepFile) ReadDotEnv() (map[string]string, error)
- func (s *StepFile) ReadEnvironment() (*Environment, error)
- func (s *StepFile) ReadKeyValueLines() (map[string]*structpb.Value, error)
- func (s *StepFile) ReadStepResult() (*proto.StepResult, error)
- func (s *StepFile) ReadValues(specOutputs map[string]*proto.Spec_Content_Output) (map[string]*structpb.Value, error)
- func (s *StepFile) Remove() error
- type StepFileLine
- type StepFunc
- type StepFuncFinder
- type StepFunction
- type StepFunctionRepository
- type StepParser
- type StepReference
- type StepResource
- type StepResourceParser
- type StepResultBuilder
- func (bldr *StepResultBuilder) Build() *proto.StepResult
- func (bldr *StepResultBuilder) BuildFailure() *proto.StepResult
- func (bldr *StepResultBuilder) ObserveEnv(env *Environment, err error) error
- func (bldr *StepResultBuilder) ObserveExecutedCmd(execResult *ExecResult, err error) error
- func (bldr *StepResultBuilder) ObserveExports(exports *Environment, err error) (*Environment, error)
- func (bldr *StepResultBuilder) ObserveOutputs(outputs map[string]*structpb.Value, err error) error
- func (bldr *StepResultBuilder) ObserveStepResult(stepResult *proto.StepResult, err error) (*proto.StepResult, error)
- func (bldr *StepResultBuilder) WithEnv(env map[string]string) *StepResultBuilder
- func (bldr *StepResultBuilder) WithExecResult(executedCmd *ExecResult) *StepResultBuilder
- func (bldr *StepResultBuilder) WithExports(exports *Environment) *StepResultBuilder
- func (bldr *StepResultBuilder) WithOutputs(outputs map[string]*structpb.Value) *StepResultBuilder
- func (bldr *StepResultBuilder) WithSubStepResult(result *proto.StepResult) *StepResultBuilder
- type StepsContext
- func (s *StepsContext) AddGlobalEnv(env *Environment)
- func (s *StepsContext) Cleanup()
- func (s *StepsContext) EnvWithLexicalScope(envVars map[string]string) *Environment
- func (s *StepsContext) ExpandAndApplyEnv(env map[string]string) (*Environment, error)
- func (s *StepsContext) GetEnv(name string) string
- func (s *StepsContext) GetEnvList() []string
- func (s *StepsContext) GetEnvs() map[string]string
- func (s *StepsContext) GetExportFile() string
- func (s *StepsContext) GetInput(name string, kind Kind) (*structpb.Value, error)
- func (s *StepsContext) GetInputWithDefault(name string, kind Kind, inputSpec map[string]*proto.Spec_Content_Input) (*structpb.Value, error)
- func (s *StepsContext) GetOutputFile() string
- func (s *StepsContext) Logln(format string, v ...any) error
- func (s *StepsContext) LookupEnv(key string) (string, bool)
- func (s *StepsContext) Pipe() (io.Writer, io.Writer)
- func (s *StepsContext) ProjectDir() string
- func (s *StepsContext) ReadExportedEnv() (*Environment, error)
- func (s *StepsContext) ReadOutputStepResult() (*proto.StepResult, error)
- func (s *StepsContext) ReadOutputValues(specOutputs map[string]*proto.Spec_Content_Output) (map[string]*structpb.Value, error)
- func (s *StepsContext) RecordResult(stepResult *proto.StepResult)
- func (s *StepsContext) StepResults() []*proto.StepResult
- func (s *StepsContext) View() *expression.InterpolationContext
- func (s *StepsContext) WorkDir() string
Constants ¶
This section is empty.
Variables ¶
var LogLevelEnvName = "CI_STEPS_LOG_LEVEL"
var RunningInDebugMode, _ = strconv.ParseBool(os.Getenv("CI_STEPS_DEBUG"))
var StepDefinedInGitLabJob = NewNamedStepReference("", nil)
StepDefinedInGitLabJob is a step defined in a GitLab jobs using the run: syntax or STEPS: variable
Functions ¶
func WithErrCtxLogAdditionalCtx ¶ added in v0.2.0
func WithStepsCtxExportFile ¶ added in v0.7.0
func WithStepsCtxExportFile(exportFile *StepFile) func(*StepsContext)
func WithStepsCtxOutputFile ¶ added in v0.7.0
func WithStepsCtxOutputFile(outputFile *StepFile) func(*StepsContext)
func WithStepsCtxStepResults ¶ added in v0.7.0
func WithStepsCtxStepResults(results map[string]*proto.StepResult) func(*StepsContext)
Types ¶
type Describer ¶
type Describer interface {
Describe() string
}
Describer types know how to describe themselves in a language to be read by humans
type DynamicStepResource ¶ added in v0.9.0
type DynamicStepResource struct {
// contains filtered or unexported fields
}
DynamicStepResource knows how to convert an expression into a step resource
func NewDynamicStepResource ¶ added in v0.9.0
func NewDynamicStepResource(parser stepResourceParser, workDir, shortRef string) *DynamicStepResource
func (*DynamicStepResource) Fetch ¶ added in v0.9.0
func (sr *DynamicStepResource) Fetch(ctx context.Context, view *expression.InterpolationContext) (*FunctionDescriptor, error)
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment represents environment variables. Environment variables are used in places such as the step export_file, step definitions with ENV, and OS environment. Environment does not merge maps, and so does not lose information. Merging of environments occurs when values are retrieved. An environment can be added as "lexical scope", these values have higher precedence when looking up a variable. Mutations to the environment take precedence over initialized variables, most recent mutations have the highest precedence
func GlobalEnvironment ¶ added in v0.6.0
func GlobalEnvironment(parent *Environment, jobVars JobVariables) (*Environment, error)
GlobalEnvironment sets environment variables that are always available for any step
func NewEmptyEnvironment ¶
func NewEmptyEnvironment() *Environment
func NewEnvironment ¶
func NewEnvironment(vars map[string]string) *Environment
func NewEnvironmentFromOS ¶
func NewEnvironmentFromOS(rejectIf ...func(string) bool) (*Environment, error)
NewEnvironmentFromOS returns the environment variables found in the OS runtime. Variables can be filtered by name, passing no names will return all variables.
func NewEnvironmentFromOSWithKnownVars ¶
func NewEnvironmentFromOSWithKnownVars() (*Environment, error)
func NewKVEnvironment ¶
func NewKVEnvironment(keyValues ...string) *Environment
NewKVEnvironment creates an environment from a list of key values
func (*Environment) AddLexicalScope ¶
func (e *Environment) AddLexicalScope(vars map[string]string) *Environment
func (*Environment) Len ¶
func (e *Environment) Len() int
func (*Environment) Mutate ¶
func (e *Environment) Mutate(env *Environment)
Mutate adds a mutation to the environment.
func (*Environment) ValueOf ¶
func (e *Environment) ValueOf(key string) string
ValueOf returns the value of a specific environment variable. This ensures consistency by acquiring locks in the same order as Values().
func (*Environment) Values ¶
func (e *Environment) Values() map[string]string
Values returns a merged map of all environment variables. This method ensures a consistent snapshot by acquiring all locks in the chain.
type ErrorCtx ¶ added in v0.2.0
type ErrorCtx struct {
// contains filtered or unexported fields
}
func NewErrorCtx ¶ added in v0.2.0
type ExecResult ¶
type ExecResult struct {
// contains filtered or unexported fields
}
func NewExecResult ¶
func NewExecResult(workDir string, cmdArgs []string, exitCode int) *ExecResult
func (*ExecResult) ToProto ¶
func (ec *ExecResult) ToProto() *proto.StepResult_ExecResult
type ExecutableStep ¶
type ExecutableStep struct {
// contains filtered or unexported fields
}
ExecutableStep is a step that executes a command.
func NewExecutableStep ¶
func NewExecutableStep(loadedFrom StepReference, params *Params, funcDesc *FunctionDescriptor) *ExecutableStep
func (*ExecutableStep) Describe ¶
func (s *ExecutableStep) Describe() string
func (*ExecutableStep) Run ¶
func (s *ExecutableStep) Run(ctx ctx.Context, stepsCtx *StepsContext) (*proto.StepResult, error)
type FileSystemStepResource ¶
type FileSystemStepResource struct {
// contains filtered or unexported fields
}
FileSystemStepResource knows how to load a step from the file system using an absolute path
func NewFileSystemStepResource ¶
func NewFileSystemStepResource(workDir string, stepPath, filename string) *FileSystemStepResource
func (*FileSystemStepResource) Describe ¶
func (sr *FileSystemStepResource) Describe() string
func (*FileSystemStepResource) Fetch ¶ added in v0.9.0
func (sr *FileSystemStepResource) Fetch(_ context.Context, view *expression.InterpolationContext) (*FunctionDescriptor, error)
type FixedStepResource ¶ added in v0.9.0
type FixedStepResource struct {
// contains filtered or unexported fields
}
func NewFixedStepResource ¶ added in v0.9.0
func NewFixedStepResource(funcDesc *FunctionDescriptor) *FixedStepResource
func (*FixedStepResource) Fetch ¶ added in v0.9.0
func (sr *FixedStepResource) Fetch(_ context.Context, _ *expression.InterpolationContext) (*FunctionDescriptor, error)
type FunctionDescriptor ¶ added in v0.24.0
type FunctionDescriptor struct {
// contains filtered or unexported fields
}
FunctionDescriptor describes a Function that has been fetched
func NewFunctionDescriptor ¶ added in v0.24.0
func NewFunctionDescriptor(spec *proto.Spec, definition *proto.Definition, dir string) *FunctionDescriptor
NewFunctionDescriptor creates a FunctionDescriptor If the function has been fetched, directory should be the location where the function files are downloaded If the function is dynamic, dir should be empty string
func (*FunctionDescriptor) DefinitionOutputs ¶ added in v0.24.0
func (sd *FunctionDescriptor) DefinitionOutputs() map[string]*structpb.Value
func (*FunctionDescriptor) DelegateTo ¶ added in v0.24.0
func (sd *FunctionDescriptor) DelegateTo() string
func (*FunctionDescriptor) DescribeType ¶ added in v0.24.0
func (sd *FunctionDescriptor) DescribeType() string
func (*FunctionDescriptor) Dir ¶ added in v0.24.0
func (sd *FunctionDescriptor) Dir() string
func (*FunctionDescriptor) Env ¶ added in v0.24.0
func (sd *FunctionDescriptor) Env() map[string]string
func (*FunctionDescriptor) ExecCommand ¶ added in v0.24.0
func (sd *FunctionDescriptor) ExecCommand() []string
func (*FunctionDescriptor) ExecWorkDir ¶ added in v0.24.0
func (sd *FunctionDescriptor) ExecWorkDir() string
func (*FunctionDescriptor) FunctionName ¶ added in v0.24.0
func (sd *FunctionDescriptor) FunctionName() string
func (*FunctionDescriptor) IsDelegateOutputs ¶ added in v0.24.0
func (sd *FunctionDescriptor) IsDelegateOutputs() bool
func (*FunctionDescriptor) IsTypeExec ¶ added in v0.24.0
func (sd *FunctionDescriptor) IsTypeExec() bool
func (*FunctionDescriptor) IsTypeFunction ¶ added in v0.24.0
func (sd *FunctionDescriptor) IsTypeFunction() bool
func (*FunctionDescriptor) IsTypeSteps ¶ added in v0.24.0
func (sd *FunctionDescriptor) IsTypeSteps() bool
func (*FunctionDescriptor) SpecInputWithName ¶ added in v0.24.0
func (sd *FunctionDescriptor) SpecInputWithName(name string) (*proto.Spec_Content_Input, bool)
func (*FunctionDescriptor) SpecInputs ¶ added in v0.24.0
func (sd *FunctionDescriptor) SpecInputs() map[string]*proto.Spec_Content_Input
func (*FunctionDescriptor) SpecOutputs ¶ added in v0.24.0
func (sd *FunctionDescriptor) SpecOutputs() map[string]*proto.Spec_Content_Output
func (*FunctionDescriptor) Steps ¶ added in v0.24.0
func (sd *FunctionDescriptor) Steps() []*proto.Step
func (*FunctionDescriptor) ToProto ¶ added in v0.24.0
func (sd *FunctionDescriptor) ToProto() *proto.SpecDefinition
type FunctionStepResource ¶ added in v0.17.0
type FunctionStepResource struct {
// contains filtered or unexported fields
}
FunctionStepResource knows how to load a step from the known registered step functions
func NewFunctionStepResource ¶ added in v0.17.0
func NewFunctionStepResource(functionName string, findStepFunction StepFuncFinder) *FunctionStepResource
func (*FunctionStepResource) Fetch ¶ added in v0.17.0
func (r *FunctionStepResource) Fetch(_ context.Context, _ *expression.InterpolationContext) (*FunctionDescriptor, error)
type GitStepResource ¶
type GitStepResource struct {
// contains filtered or unexported fields
}
GitStepResource knows how to load a step from a Git repository
func NewGitStepResource ¶
func NewGitStepResource(fetcher *git.GitFetcher, url string, version string, stepDir string, filename string) *GitStepResource
func (*GitStepResource) Fetch ¶ added in v0.9.0
func (sr *GitStepResource) Fetch(ctx context.Context, view *expression.InterpolationContext) (*FunctionDescriptor, error)
type GlobalContext ¶
type GlobalContext struct {
// contains filtered or unexported fields
}
func NewGlobalContext ¶
func NewGlobalContext(workDir string, job JobVariables, env *Environment, stdout, stderr io.Writer) *GlobalContext
func (*GlobalContext) AddGlobalEnv ¶ added in v0.7.0
func (gc *GlobalContext) AddGlobalEnv(env *Environment)
func (*GlobalContext) Env ¶
func (gc *GlobalContext) Env() *Environment
func (*GlobalContext) EnvWithLexicalScope ¶ added in v0.7.0
func (gc *GlobalContext) EnvWithLexicalScope(envVars map[string]string) *Environment
func (*GlobalContext) Job ¶
func (gc *GlobalContext) Job() JobVariables
func (*GlobalContext) Logf ¶ added in v0.2.0
func (gc *GlobalContext) Logf(format string, v ...any) error
func (*GlobalContext) Logln ¶ added in v0.2.0
func (gc *GlobalContext) Logln(format string, v ...any) error
func (*GlobalContext) LookupEnv ¶ added in v0.20.0
func (gc *GlobalContext) LookupEnv(key string) (string, bool)
func (*GlobalContext) ProjectDir ¶ added in v0.18.0
func (gc *GlobalContext) ProjectDir() string
func (*GlobalContext) WorkDir ¶
func (gc *GlobalContext) WorkDir() string
type JobVariables ¶ added in v0.16.0
func (JobVariables) ProjectDir ¶ added in v0.18.0
func (v JobVariables) ProjectDir() string
func (JobVariables) StringValueOf ¶ added in v0.16.0
func (v JobVariables) StringValueOf(key string) string
type LazilyLoadedStep ¶
type LazilyLoadedStep struct {
// contains filtered or unexported fields
}
LazilyLoadedStep is a step that dynamically fetches, parses and executes a step definition.
func NewLazilyLoadedStep ¶
func NewLazilyLoadedStep(globalCtx *GlobalContext, parser StepParser, stepReference *proto.Step, stepResource StepResource) *LazilyLoadedStep
func (*LazilyLoadedStep) Describe ¶
func (s *LazilyLoadedStep) Describe() string
func (*LazilyLoadedStep) Run ¶
func (s *LazilyLoadedStep) Run(ctx ctx.Context, parentStepsCtx *StepsContext) (*proto.StepResult, error)
Run fetches a step definition, parses the step, and executes it. The step reference inputs and environment are expanded. The current environment is cloned into params in preparation for a recursive call to Run.
type NamedStepReference ¶
type NamedStepReference struct {
// contains filtered or unexported fields
}
NamedStepReference is a step that is loaded using a name and a reference
func NewNamedStepReference ¶
func NewNamedStepReference(name string, ref *proto.Step_Reference) *NamedStepReference
func (*NamedStepReference) Describe ¶ added in v0.2.0
func (sr *NamedStepReference) Describe() string
func (*NamedStepReference) ToProtoStep ¶
func (sr *NamedStepReference) ToProtoStep(params *Params) *proto.Step
type Params ¶
Params are the input and environment parameters for an execution.
func (*Params) NewInputsWithDefault ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(stepResParser *StepResourceParser, stepFuncFinder StepFuncFinder) *Parser
func (*Parser) Parse ¶
func (p *Parser) Parse(globalCtx *GlobalContext, funcDesc *FunctionDescriptor, params *Params, loadedFrom StepReference) (Step, error)
type SequenceOfSteps ¶
type SequenceOfSteps struct {
// contains filtered or unexported fields
}
SequenceOfSteps is a step that executes many steps.
func NewSequenceOfSteps ¶
func NewSequenceOfSteps(loadedFrom StepReference, params *Params, funcDesc *FunctionDescriptor, steps ...Step) *SequenceOfSteps
func (*SequenceOfSteps) Describe ¶
func (s *SequenceOfSteps) Describe() string
func (*SequenceOfSteps) Run ¶
func (s *SequenceOfSteps) Run(ctx ctx.Context, stepsCtx *StepsContext) (*proto.StepResult, error)
type Step ¶
type Step interface {
Describer
Run(ctx ctx.Context, stepsCtx *StepsContext) (*proto.StepResult, error)
}
type StepFile ¶
type StepFile struct {
// contains filtered or unexported fields
}
func NewStepFile ¶
func NewStepFileInDir ¶
func NewStepFileInTmp ¶
func (*StepFile) ReadEnvironment ¶
func (s *StepFile) ReadEnvironment() (*Environment, error)
func (*StepFile) ReadKeyValueLines ¶
func (*StepFile) ReadStepResult ¶
func (s *StepFile) ReadStepResult() (*proto.StepResult, error)
func (*StepFile) ReadValues ¶
type StepFileLine ¶ added in v0.2.0
type StepFunc ¶ added in v0.17.0
type StepFunc func(ctx context.Context, stepsCtx *StepsContext) error
type StepFuncFinder ¶ added in v0.17.0
type StepFunction ¶ added in v0.17.0
type StepFunction struct {
// contains filtered or unexported fields
}
StepFunction is a step that executes a step as a function. Only functions registered as steps can be called.
func NewStepFunction ¶ added in v0.17.0
func NewStepFunction(loadedFrom StepReference, params *Params, funcDesc *FunctionDescriptor, stepFuncFinder StepFuncFinder) *StepFunction
func (*StepFunction) Describe ¶ added in v0.17.0
func (s *StepFunction) Describe() string
func (*StepFunction) Run ¶ added in v0.17.0
func (s *StepFunction) Run(ctx ctx.Context, stepsCtx *StepsContext) (*proto.StepResult, error)
type StepFunctionRepository ¶ added in v0.17.0
type StepFunctionRepository struct {
// contains filtered or unexported fields
}
func NewStepFunctionRepository ¶ added in v0.17.0
func NewStepFunctionRepository() *StepFunctionRepository
type StepParser ¶
type StepParser interface {
Parse(*GlobalContext, *FunctionDescriptor, *Params, StepReference) (Step, error)
}
type StepReference ¶
StepReference knows how the step was loaded
type StepResource ¶
type StepResource interface {
Fetch(context.Context, *expression.InterpolationContext) (*FunctionDescriptor, error)
}
StepResource knows how to load a Step
type StepResourceParser ¶ added in v0.9.0
type StepResourceParser struct {
// contains filtered or unexported fields
}
func NewStepResourceParser ¶ added in v0.9.0
func NewStepResourceParser(gitFetcher *git.GitFetcher, stepFuncFinder StepFuncFinder) *StepResourceParser
func (*StepResourceParser) Parse ¶ added in v0.9.0
func (p *StepResourceParser) Parse(workDir string, stepRef *proto.Step_Reference) (StepResource, error)
type StepResultBuilder ¶
type StepResultBuilder struct {
// contains filtered or unexported fields
}
func NewStepResultBuilder ¶
func NewStepResultBuilder(loadedFrom StepReference, params *Params, funcDesc *FunctionDescriptor) *StepResultBuilder
func (*StepResultBuilder) Build ¶
func (bldr *StepResultBuilder) Build() *proto.StepResult
func (*StepResultBuilder) BuildFailure ¶
func (bldr *StepResultBuilder) BuildFailure() *proto.StepResult
func (*StepResultBuilder) ObserveEnv ¶
func (bldr *StepResultBuilder) ObserveEnv(env *Environment, err error) error
func (*StepResultBuilder) ObserveExecutedCmd ¶
func (bldr *StepResultBuilder) ObserveExecutedCmd(execResult *ExecResult, err error) error
func (*StepResultBuilder) ObserveExports ¶
func (bldr *StepResultBuilder) ObserveExports(exports *Environment, err error) (*Environment, error)
func (*StepResultBuilder) ObserveOutputs ¶
func (*StepResultBuilder) ObserveStepResult ¶
func (bldr *StepResultBuilder) ObserveStepResult(stepResult *proto.StepResult, err error) (*proto.StepResult, error)
func (*StepResultBuilder) WithEnv ¶
func (bldr *StepResultBuilder) WithEnv(env map[string]string) *StepResultBuilder
func (*StepResultBuilder) WithExecResult ¶
func (bldr *StepResultBuilder) WithExecResult(executedCmd *ExecResult) *StepResultBuilder
func (*StepResultBuilder) WithExports ¶
func (bldr *StepResultBuilder) WithExports(exports *Environment) *StepResultBuilder
func (*StepResultBuilder) WithOutputs ¶
func (bldr *StepResultBuilder) WithOutputs(outputs map[string]*structpb.Value) *StepResultBuilder
func (*StepResultBuilder) WithSubStepResult ¶
func (bldr *StepResultBuilder) WithSubStepResult(result *proto.StepResult) *StepResultBuilder
type StepsContext ¶
type StepsContext struct {
// contains filtered or unexported fields
}
func NewStepsContext ¶
func NewStepsContext(globalCtx *GlobalContext, stepDir string, inputs map[string]*structpb.Value, env *Environment, options ...func(*StepsContext)) (*StepsContext, error)
func (*StepsContext) AddGlobalEnv ¶ added in v0.7.0
func (s *StepsContext) AddGlobalEnv(env *Environment)
func (*StepsContext) Cleanup ¶
func (s *StepsContext) Cleanup()
func (*StepsContext) EnvWithLexicalScope ¶ added in v0.7.0
func (s *StepsContext) EnvWithLexicalScope(envVars map[string]string) *Environment
func (*StepsContext) ExpandAndApplyEnv ¶
func (s *StepsContext) ExpandAndApplyEnv(env map[string]string) (*Environment, error)
func (*StepsContext) GetEnv ¶ added in v0.17.0
func (s *StepsContext) GetEnv(name string) string
func (*StepsContext) GetEnvList ¶
func (s *StepsContext) GetEnvList() []string
func (*StepsContext) GetEnvs ¶
func (s *StepsContext) GetEnvs() map[string]string
func (*StepsContext) GetExportFile ¶ added in v0.17.0
func (s *StepsContext) GetExportFile() string
func (*StepsContext) GetInputWithDefault ¶ added in v0.18.0
func (s *StepsContext) GetInputWithDefault(name string, kind Kind, inputSpec map[string]*proto.Spec_Content_Input) (*structpb.Value, error)
func (*StepsContext) GetOutputFile ¶ added in v0.17.0
func (s *StepsContext) GetOutputFile() string
func (*StepsContext) Logln ¶ added in v0.7.0
func (s *StepsContext) Logln(format string, v ...any) error
func (*StepsContext) LookupEnv ¶ added in v0.20.0
func (s *StepsContext) LookupEnv(key string) (string, bool)
func (*StepsContext) ProjectDir ¶ added in v0.18.0
func (s *StepsContext) ProjectDir() string
func (*StepsContext) ReadExportedEnv ¶ added in v0.7.0
func (s *StepsContext) ReadExportedEnv() (*Environment, error)
func (*StepsContext) ReadOutputStepResult ¶ added in v0.7.0
func (s *StepsContext) ReadOutputStepResult() (*proto.StepResult, error)
func (*StepsContext) ReadOutputValues ¶ added in v0.7.0
func (s *StepsContext) ReadOutputValues(specOutputs map[string]*proto.Spec_Content_Output) (map[string]*structpb.Value, error)
func (*StepsContext) RecordResult ¶
func (s *StepsContext) RecordResult(stepResult *proto.StepResult)
RecordResult captures the result of a step even if it failed
func (*StepsContext) StepResults ¶
func (s *StepsContext) StepResults() []*proto.StepResult
func (*StepsContext) View ¶
func (s *StepsContext) View() *expression.InterpolationContext
func (*StepsContext) WorkDir ¶ added in v0.7.0
func (s *StepsContext) WorkDir() string
Source Files
¶
- describer.go
- dynamic_step_resource.go
- environment.go
- error_ctx.go
- exec_result.go
- executable_step.go
- file_system_step_resource.go
- fixed_step_resource.go
- function_descriptor.go
- function_step_resource.go
- git_step_resource.go
- global_context.go
- global_env.go
- job_variables.go
- kind.go
- lazily_loaded_step.go
- named_step_reference.go
- runner.go
- sequence_of_steps.go
- step.go
- step_file.go
- step_function.go
- step_function_repository.go
- step_parser.go
- step_reference.go
- step_resource.go
- step_resource_parser.go
- step_result_builder.go
- steps_context.go