api

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

This section is empty.

Variables

View Source
var BuiltinActions = make(map[string]ActionStep)

Functions

func EnrichEnvironment

func EnrichEnvironment(projectDirectory string, branchingConvention string, env map[string]string) error

EnrichEnvironment enriches the environment with CID variables / release information

func FillEnvPlaceholders

func FillEnvPlaceholders(input string, env map[string]string) string

FillEnvPlaceholders replaces all placeholders within the string - ie. {NCI_COMMIT_COUNT}

func FindProjectDir

func FindProjectDir() string

FindProjectDir finds the project directory from the current dir

func GetCIDEnvironment

func GetCIDEnvironment(projectDirectory string) map[string]string

GetCIDEnvironment returns the normalized ci variables

func GetCacheDir

func GetCacheDir(pathConfig config.PathConfig, module string) string

GetCacheDir returns the caching directory for a module

func GetFullEnvironment

func GetFullEnvironment(projectDirectory string) map[string]string

GetFullEnvironment returns the entire env, including host + normalized variables

func IsVersionStable

func IsVersionStable(versionStr string) bool

IsVersionStable checks if the specified version is a stable release version (semver)

func RegisterBuiltinAction

func RegisterBuiltinAction(action ActionStep)

RegisterBuiltinAction registers a builtin action

Types

type ActionDetails

type ActionDetails struct {
	Stage            string
	Name             string
	Version          string
	UsedTools        []string
	ToolDependencies map[string]string
}

ActionDetails holds details about the action

type ActionExecutionContext

type ActionExecutionContext struct {
	// Paths holds the path configuration
	Paths config.PathConfig

	// ProjectDir holds the project directory
	ProjectDir string

	// WorkDir holds the current working directory
	WorkDir string

	// Config holds the yaml configuration passed to this action
	Config string

	// Args holds the arguments passed to the action
	Args []string

	// Env contains the normalized environment
	Env map[string]string

	// MachineEnv contains the full environment
	MachineEnv map[string]string
}

type ActionStep

type ActionStep interface {
	GetDetails(ctx ActionExecutionContext) ActionDetails
	Check(ctx ActionExecutionContext) bool
	Execute(ctx ActionExecutionContext)
}

Normalizer is a common interface to work with all normalizers

Jump to

Keyboard shortcuts

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