config

package
v0.1.25848 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CollaborationsPath = "me/collaborations"
)
View Source
var (

	// Making this the one true source for default config path
	DefaultConfigPath = ".circleci/config.yml"
)

Functions

func GetOrgIdFromSlug added in v0.1.25569

func GetOrgIdFromSlug(slug string, collaborations []CollaborationResult) string

GetOrgIdFromSlug - converts a slug into an orgID.

Types

type CollaborationResult added in v0.1.25569

type CollaborationResult struct {
	VcsTye    string `json:"vcs_type"`
	OrgSlug   string `json:"slug"`
	OrgName   string `json:"name"`
	OrgId     string `json:"id"`
	AvatarUrl string `json:"avatar_url"`
}

type CompileConfigRequest

type CompileConfigRequest struct {
	ConfigYaml string  `json:"config_yaml"`
	Options    Options `json:"options"`
}

CompileConfigRequest - the structure of the data we send to the downstream compilation service.

type ConfigCompiler added in v0.1.25569

type ConfigCompiler struct {
	// contains filtered or unexported fields
}

func New added in v0.1.25569

func New(cfg *settings.Config) *ConfigCompiler

func (*ConfigCompiler) ConfigQuery added in v0.1.25569

func (c *ConfigCompiler) ConfigQuery(
	configPath string,
	orgID string,
	params Parameters,
	values Values,
) (*ConfigResponse, error)

ConfigQuery - attempts to compile or validate a given config file with the passed in params/values. If the orgID is passed in, the config-compilation with private orbs should work.

func (*ConfigCompiler) GetOrgCollaborations added in v0.1.25569

func (c *ConfigCompiler) GetOrgCollaborations() ([]CollaborationResult, error)

GetOrgCollaborations - fetches all the collaborations for a given user.

func (*ConfigCompiler) ProcessConfig added in v0.1.25569

func (c *ConfigCompiler) ProcessConfig(opts ProcessConfigOpts) error

func (*ConfigCompiler) ValidateConfig added in v0.1.25569

func (c *ConfigCompiler) ValidateConfig(opts ValidateConfigOpts) error

The <path> arg is actually optional, in order to support compatibility with the --path flag.

type ConfigError

type ConfigError struct {
	Message string `json:"message"`
}

type ConfigResponse

type ConfigResponse struct {
	Valid      bool          `json:"valid"`
	SourceYaml string        `json:"source-yaml"`
	OutputYaml string        `json:"output-yaml"`
	Errors     []ConfigError `json:"errors"`
}

ConfigResponse - the structure of what is returned from the downstream compilation endpoint

type Options

type Options struct {
	OwnerID            string                 `json:"owner_id,omitempty"`
	PipelineParameters map[string]interface{} `json:"pipeline_parameters,omitempty"`
	PipelineValues     map[string]interface{} `json:"pipeline_values,omitempty"`
}

type Parameters added in v0.1.25569

type Parameters map[string]interface{}

Static typing is bypassed using an empty interface here due to pipeline parameters supporting multiple types.

type ProcessConfigOpts added in v0.1.25569

type ProcessConfigOpts struct {
	ConfigPath             string
	OrgID                  string
	OrgSlug                string
	PipelineParamsFilePath string

	VerboseOutput bool
}

type ValidateConfigOpts added in v0.1.25569

type ValidateConfigOpts struct {
	ConfigPath string
	OrgID      string
	OrgSlug    string

	IgnoreDeprecatedImages bool
	VerboseOutput          bool
}

type Values added in v0.1.25569

type Values map[string]interface{}

CircleCI provides various `<< pipeline.x >>` values to be used in your config, but sometimes we need to fabricate those values when validating config.

func LocalPipelineValues added in v0.1.25569

func LocalPipelineValues() Values

vars should contain any pipeline parameters that should be accessible via << pipeline.parameters.foo >>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL