config

package
v0.2.0-rc.21 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PathSeparator = string(os.PathSeparator)

Variables

View Source
var Config = struct {
	Paths           PathConfig
	Mode            ExecutionModeType `default:"PREFER_LOCAL"`
	Conventions     ProjectConventions
	Env             map[string]string
	Stages          []WorkflowStage             `yaml:"stages"`
	Actions         map[string][]WorkflowAction `yaml:"actions"`
	Dependencies    map[string]string
	Tools           []ToolExecutableDiscovery `yaml:"tools"`
	ContainerImages []ToolContainerDiscovery  `yaml:"container-images"`
}{}

Functions

func FindExecutable

func FindExecutable(path string, file string) string

func IsVersionFulfillingConstraint

func IsVersionFulfillingConstraint(version string, constraint string) bool

func LoadConfig

func LoadConfig(projectDirectory string)

func LoadConfigurationFile

func LoadConfigurationFile(config interface{}, file string) (err error)

Types

type BranchingConventionType

type BranchingConventionType string

BranchingConventionType

const (
	BranchingGitFlow BranchingConventionType = "GitFlow"
)

type CommitConventionType

type CommitConventionType string

BranchingConventionType

const (
	ConventionalCommits CommitConventionType = "ConventionalCommits"
)

type ExecutionModeType

type ExecutionModeType string

ExecutionModeType

const (
	PreferLocal ExecutionModeType = "PREFER_LOCAL"
	Strict      ExecutionModeType = "STRICT"
)

type PathConfig

type PathConfig struct {
	Artifact string `default:"dist"`
	Cache    string `default:""`
}

PathConfig contains the path configuration for build/tmp directories

type ProjectConventions

type ProjectConventions struct {
	Branching        BranchingConventionType `default:"GitFlow"`
	Commit           CommitConventionType    `default:"ConventionalCommits"`
	PreReleaseSuffix string                  `default:"-rc.{NCI_LASTRELEASE_COMMIT_AFTER_COUNT}"`
}

type ToolCacheDir

type ToolCacheDir struct {
	Id            string
	ContainerPath string `yaml:"dir"`
}

type ToolContainerDiscovery

type ToolContainerDiscovery struct {
	Executable string
	Image      string
	Version    string
	Cache      []ToolCacheDir
}

func FindContainerImage

func FindContainerImage(executable string, constraint string) (ToolContainerDiscovery, error)

type ToolExecutableDiscovery

type ToolExecutableDiscovery struct {
	Executable            string
	ExecutableFile        string
	EnvironmentName       string   `yaml:"env-name"`
	EnvironmentNameSuffix []string `yaml:"env-allowed-suffix"`
	SubPath               string   `yaml:"env-path-dir"`
	Version               string
}

func FindLocalTool

func FindLocalTool(executable string, constraint string) (ToolExecutableDiscovery, error)

FindLocalTool tries to find a tool/cli fulfilling the specified version constraints in the local environment

type WorkflowAction

type WorkflowAction struct {
	Name   string      `required:"true"`
	Type   string      `default:"builtin"`
	Config interface{} `yaml:"config,omitempty"`
}

type WorkflowRule

type WorkflowRule struct {
	Expression string
}

type WorkflowStage

type WorkflowStage struct {
	Name    string
	Rules   []WorkflowRule
	Actions []WorkflowAction
}

Jump to

Keyboard shortcuts

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