Documentation
¶
Index ¶
- Variables
- func Cache() cache.Cache
- func Configure(c Configurable)
- func WithContext(mutator func(ctx context.Context) context.Context)
- type Artifact
- type BuildVariables
- type BuildVariablesBuilder
- type Builder
- type Config
- type Configurable
- type Configurator
- type Configured
- type Dependencies
- type MageTag
- type Metadata
- type Notifier
- type Publisher
- type Resolver
- type Result
- type ResultKey
- type Task
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultBuilders is a list of default builders. DefaultBuilders = make([]Builder, 0) // DefaultPublishers is a list of default publishers. DefaultPublishers = make([]Publisher, 0) )
Functions ¶
func Configure ¶ added in v0.5.0
func Configure(c Configurable)
Configure with provided Configurable.
Types ¶
type BuildVariables ¶ added in v0.5.1
BuildVariables will be passed to a Golang's ldflags for variable injection.
type BuildVariablesBuilder ¶ added in v0.5.1
type BuildVariablesBuilder interface { // Add a key/value pair. Add(key string, resolver Resolver) BuildVariablesBuilder // ConditionallyAdd a key/value pair if cnd is true. ConditionallyAdd(cnd func() bool, key string, resolver Resolver) BuildVariablesBuilder // Build a build variables instance. Build() BuildVariables }
BuildVariablesBuilder for a build variables.
func NewBuildVariablesBuilder ¶ added in v0.5.1
func NewBuildVariablesBuilder() BuildVariablesBuilder
NewBuildVariablesBuilder creates a new BuildVariablesBuilder.
type Builder ¶ added in v0.5.0
type Builder interface { Accepts(artifact Artifact) bool Build(artifact Artifact, notifier Notifier) Result }
Builder builds an artifact.
type Config ¶ added in v0.5.0
type Config struct { // ProjectDir holds a path to the project. ProjectDir string // BuildDirPath holds a build directory path. BuildDirPath []string // Version contains the version information. *Version // MageTag holds default mage tag settings. MageTag // Dependencies will hold additional Golang dependencies that needs to be // installed before running tasks. Dependencies Dependencies // Artifacts holds a list of artifacts to be built. Artifacts []Artifact // Builders holds a list of Builder's to be used for building project // artifacts. If none is configured, default ones will be used. Builders []Builder // Publishers holds a list of Publisher's to be used for publishing project // artifacts. If none is configured, default ones will be used. Publishers []Publisher // Cleaning additional cleaning tasks. Cleaning []Task // Checks holds a list of checks to perform. Checks []Task // BuildVariables holds extra list of variables to be passed to Golang's // ldflags. BuildVariables // Overrides holds a list of overrides of this configuration. Overrides []Configurator // context.Context is standard Golang context. context.Context }
Config holds configuration information.
func FillInDefaultValues ¶ added in v0.5.0
FillInDefaultValues in provided config and returns a filled one.
type Configurable ¶ added in v0.5.0
type Configurable interface {
Config() *Config
}
Configurable will allow changes of the Config structure.
type Configurator ¶ added in v0.5.0
type Configurator interface {
Configure(cfg Configurable)
}
Configurator will configure project.
type Configured ¶ added in v0.5.0
type Configured interface{}
Configured represents a configured project.
type Dependencies ¶
type Dependencies interface { Configurator Installs() []string // contains filtered or unexported methods }
func NewDependencies ¶ added in v0.5.0
func NewDependencies(deps ...string) Dependencies
type Metadata ¶ added in v0.5.0
type Metadata struct { Name string BuildVariables }
Metadata holds additional contextual information.
type Notifier ¶ added in v0.5.0
type Notifier interface {
Notify(status string)
}
Notifier can notify of a pending status of long task.
type Publisher ¶ added in v0.5.0
type Publisher interface { Accepts(artifact Artifact) bool Publish(artifact Artifact, notifier Notifier) Result }
Publisher publishes artifacts to a remote site.
type Resolver ¶ added in v0.5.0
type Resolver func() string
Resolver is a func that resolves to a string.
func StaticResolver ¶ added in v0.5.0
StaticResolver can be used to create a Resolver from static data.
type ResultKey ¶ added in v0.5.0
type ResultKey string
ResultKey is used to store results of a build or publish.