Documentation
¶
Index ¶
- type Artifact
- type ArtifactType
- type Task
- func (t *Task) Duration() time.Duration
- func (t *Task) End() time.Time
- func (t *Task) Error() error
- func (t *Task) ErrorMessage() string
- func (t *Task) Errored() bool
- func (t *Task) ExitCode() int16
- func (t *Task) GetVariations() []map[string]string
- func (t *Task) Output() string
- func (t *Task) Skipped() bool
- func (t *Task) Start() time.Time
- func (t *Task) WithEnd(end time.Time) *Task
- func (t *Task) WithEnv(key, value string) *Task
- func (t *Task) WithError(val error) *Task
- func (t *Task) WithExitCode(val int16) *Task
- func (t *Task) WithSkipped(val bool) *Task
- func (t *Task) WithStart(start time.Time) *Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶ added in v1.7.0
type Artifact struct {
// Name is the key under which the artifacts will be stored
//
// Currently this is unused
Name string `mapstructure:"name" yaml:"name,omitempty" json:"name,omitempty"`
// Path is the glob like pattern to the
// source of the file(s) to store as an output
Path string `mapstructure:"path" yaml:"path" json:"path"`
// Type is the artifact type
// valid values are `file`|`dotenv`
Type ArtifactType `mapstructure:"type" yaml:"type" json:"type" jsonschema:"enum=dotenv,enum=file,default=file"`
}
Artifact holds the information about the artifact to produce for the specific task.
NB: it is run at the end of the task so any after commands that mutate the output files/dotenv file will essentially overwrite anything set/outputted as part of the main command
type ArtifactType ¶ added in v1.7.0
type ArtifactType string
const ( FileArtifactType ArtifactType = "file" DotEnvArtifactType ArtifactType = "dotenv" )
type Task ¶
type Task struct {
Commands []string // Commands to run
Context string
Env variables.Container
Variables variables.Container
Variations []map[string]string
Dir string
Timeout *time.Duration
AllowFailure bool
After []string
Before []string
Interactive bool
// ResetContext is useful if multiple variations are running in the same task
ResetContext bool
Condition string
Artifacts *Artifact
Name string
Description string
Log struct {
Stderr *bytes.Buffer
Stdout *bytes.Buffer
}
// Generator Task Level
Generator map[string]any
// contains filtered or unexported fields
}
Task is a structure that describes task, its commands, environment, working directory etc. After task completes it provides task's execution status, exit code, stdout and stderr
func FromCommands ¶
FromCommands creates task new Task instance with given commands
func (*Task) ErrorMessage ¶
ErrorMessage returns message of the error occurred during task execution
func (*Task) GetVariations ¶
GetVariations returns array of maps which are task's variations if no variations exist one is returned to create the default job