Documentation
¶
Overview ¶
Package configcmd contains the business logic for circleci config subcommands.
Index ¶
Constants ¶
const ( FunctionsTip = "CircleCI Functions can replace orbs and install languages and tools in a new config. Orbs remain supported." FunctionsTipNext = "Run `circleci function list` to find one, then `circleci function get <name>` for its arguments and an example." )
The tip `config validate` shows for a new config with no functions block. It names no Function, because `circleci function list` is the catalog.
Variables ¶
This section is empty.
Functions ¶
func LocalPipelineValues ¶
LocalPipelineValues fabricates the CircleCI pipeline values used when validating or processing a config locally. Git state is read best-effort; failures are silent. params are merged as pipeline.parameters.<key> and also returned separately so callers can pass them as PipelineParameters.
func ParsePipelineParams ¶
ParsePipelineParams parses pipeline parameters from either a YAML/JSON string or a file path. A file is tried first; only when the path does not exist is the value parsed as inline YAML. An empty input yields a nil map and no error.
Types ¶
type Suggestion ¶ added in v1.15.0
type Suggestion struct {
Message string `json:"message"`
}
Suggestion is a tip `config validate` reports alongside a valid config.
func FunctionsSuggestions ¶ added in v1.15.0
func FunctionsSuggestions(path, configYAML string) []Suggestion
FunctionsSuggestions returns the Functions tip for a config file that is new and declares no functions, or nothing.
type ValidateResult ¶
type ValidateResult struct {
Valid bool `json:"valid"`
CompiledYAML string `json:"compiled_yaml,omitempty"`
Errors []string `json:"errors,omitempty"`
// Suggestions is never nil, so --json shows an empty array.
Suggestions []Suggestion `json:"suggestions"`
}
ValidateResult holds the outcome of a config validation call.
func Process ¶
func Process(ctx context.Context, client *apiclient.Client, configYAML, orgID string, previewNext bool, params map[string]any) (*ValidateResult, error)
Process compiles the config YAML and returns the fully expanded output YAML. params are pipeline parameters injected at << pipeline.parameters.* >>.
func Validate ¶
func Validate(ctx context.Context, client *apiclient.Client, configYAML, orgID string, previewNext bool) (*ValidateResult, error)
Validate compiles the config YAML against the CircleCI API and returns whether it is valid. orgID may be empty; pass one to enable private orb resolution.