Documentation
¶
Index ¶
- func EvaluateConditional(expander ExpandFunc, c *Conditional) bool
- func Expand(b []byte, expand ExpandFunc) (p []byte)
- func ExpandString(s string, expand ExpandFunc) string
- type Command
- type Conditional
- type Config
- type ExpandFunc
- type Job
- type Orb
- type Parameter
- type Parameters
- type Source
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvaluateConditional ¶
func EvaluateConditional(expander ExpandFunc, c *Conditional) bool
EvaluateConditional evaluates a Conditional, expanding any variables using the given ExpandFunc before evaluating.
func Expand ¶
func Expand(b []byte, expand ExpandFunc) (p []byte)
Expand takes bytes and an ExpandFunc. Whenever it encounters a variable in the bytes, signified by e.g. "<< example >>", it calls ExpandFunc with the variable name and replaces the variable with the result. It returns the fully expanded bytes.
func ExpandString ¶
func ExpandString(s string, expand ExpandFunc) string
ExpandString is a convenience method for Expanding strings. See Expand.
Types ¶
type Command ¶
type Command struct {
Description string `json:"description,omitempty" yaml:",omitempty"`
Parameters Parameters `json:"parameters,omitempty" yaml:",omitempty"`
Steps []Step `json:"steps,omitempty" yaml:",omitempty"`
}
type Conditional ¶
type Conditional struct {
Condition any `json:"condition,omitempty" yaml:",omitempty"`
Steps []Step `json:"steps,omitempty" yaml:",omitempty"`
}
Conditional is a `when` or `unless` in a CircleCI Orb step.
type Config ¶
type Config struct {
Version float64 `json:"version,omitempty" yaml:",omitempty"`
Orbs map[string]string `json:"orbs,omitempty" yaml:",omitempty"`
}
Config is the subset of a CircleCI configuration file relevant to finding Orb aliases.
type ExpandFunc ¶
ExpandFunc takes a variable name and returns the variable value.
func (ExpandFunc) Expand ¶
func (e ExpandFunc) Expand(b []byte) []byte
func (ExpandFunc) ExpandString ¶
func (e ExpandFunc) ExpandString(s string) string
type Parameters ¶
type Source ¶
type Source struct {
Version float64 `json:"version,omitempty" yaml:",omitempty"`
Description string `json:"description,omitempty" yaml:",omitempty"`
Display *struct {
HomeURL string `json:"home_url,omitempty" yaml:",omitempty"`
SourceURL string `json:"source_url,omitempty" yaml:",omitempty"`
} `json:"display,omitempty"`
Commands map[string]Command `json:"commands,omitempty" yaml:",omitempty"`
Executors map[string]struct {
Description string `json:"description,omitempty" yaml:",omitempty"`
Docker []struct {
Image string `json:"image,omitempty" yaml:",omitempty"`
}
Parameters Parameters `json:"parameters,omitempty" yaml:",omitempty"`
} `json:"executors,omitempty"`
Jobs map[string]Job
}
type Step ¶
type Step struct {
When *Conditional `json:"when,omitempty" yaml:",omitempty"`
Unless *Conditional `json:"unless,omitempty" yaml:",omitempty"`
Run *struct {
Name string `json:"name,omitempty" yaml:",omitempty"`
Command string `json:"command,omitempty" yaml:",omitempty"`
WorkingDirectory string `json:"working_directory,omitempty" yaml:",omitempty"`
Environment map[string]string `json:"environment,omitempty" yaml:",omitempty"`
} `json:"run,omitempty" yaml:",omitempty"`
Dynamic map[string]map[string]any `json:",inline" yaml:",inline"`
}
Step ...
steps:
- when:
condition:
equal:
- 1.0.0
- << parameters.version >>
run:
command: env
- run:
command: env
- node/install:
key: value