Documentation ¶
Overview ¶
Package mage contains re-usable and testable components for building, testing, and releasing Cape using Magefile
Index ¶
- Variables
- func FindImports(file string) ([]string, error)
- func Parallel(ctx context.Context, funcs []ParallelFunc) error
- func WaitFor(ctx context.Context, f Checker, timeout time.Duration) error
- type Artifacts
- type Chart
- type Checker
- type Cleaner
- type Cluster
- type Dependency
- type Docker
- func (d *Docker) Build(ctx context.Context, image *DockerImage) error
- func (d *Docker) Check(_ context.Context) error
- func (d *Docker) Clean(_ context.Context) error
- func (d *Docker) Connect(ctx context.Context, name, network string) error
- func (d *Docker) Name() string
- func (d *Docker) Network(_ context.Context, label string) (*NetworkSettings, error)
- func (d *Docker) Push(ctx context.Context, tag string) error
- func (d *Docker) Setup(_ context.Context) error
- func (d *Docker) Status(ctx context.Context, name string) (Status, error)
- func (d *Docker) Tag(ctx context.Context, image *DockerImage, tag string) error
- type DockerImage
- type DockerRegistry
- func (d *DockerRegistry) Check(ctx context.Context) error
- func (d *DockerRegistry) Clean(_ context.Context) error
- func (d *DockerRegistry) Connect(ctx context.Context, r *Registry, network string) error
- func (d *DockerRegistry) Create(ctx context.Context, r *Registry) (*NetworkSettings, error)
- func (d *DockerRegistry) Destroy(ctx context.Context, r *Registry) error
- func (d *DockerRegistry) Name() string
- func (d *DockerRegistry) Setup(_ context.Context) error
- func (d *DockerRegistry) Status(ctx context.Context, r *Registry) (Status, error)
- type Env
- type Errors
- type Generator
- type Git
- type GoMod
- type GoTools
- type Golang
- type GraphQL
- type Helm
- func (h *Helm) Check(_ context.Context) error
- func (h *Helm) Clean(_ context.Context) error
- func (h *Helm) Deploy(ctx context.Context, c *Chart) error
- func (h *Helm) Install(ctx context.Context, c *Chart) error
- func (h *Helm) List(_ context.Context) ([]*Release, error)
- func (h *Helm) Name() string
- func (h *Helm) RepoUpdate(_ context.Context) error
- func (h *Helm) Setup(ctx context.Context) error
- func (h *Helm) Update(ctx context.Context, c *Chart, current *Release) error
- type Kind
- func (k *Kind) Check(ctx context.Context) error
- func (k *Kind) Clean(_ context.Context) error
- func (k *Kind) Create(ctx context.Context, cluster *Cluster, registry *Registry) error
- func (k *Kind) Destroy(ctx context.Context, cluster *Cluster) error
- func (k *Kind) Name() string
- func (k *Kind) Setup(_ context.Context) error
- func (k *Kind) Status(ctx context.Context, cluster *Cluster) (Status, error)
- type Kubectl
- type NetworkSettings
- type ParallelFunc
- type Registry
- type Release
- type RunnerFunc
- type Status
- type Version
Constants ¶
This section is empty.
Variables ¶
var Dependencies = deps{}
Dependencies contains a list of external dependencies
Functions ¶
func FindImports ¶
FindImports returns a list of all imported packages inside of a given file
Types ¶
type Artifacts ¶
type Artifacts struct {
// contains filtered or unexported fields
}
var Tracker *Artifacts
Tracker is a global tracker of build artifacts
type Cleaner ¶
func CleanDockerImage ¶
func CleanDockerImage(image *DockerImage) Cleaner
func CleanDockerRegistry ¶
type Cluster ¶
TODO: Configure kubectl/helm/kind to use a _different_ kubectl config path for local development work, or, have them set the context for each command to be the cluster creatd by kind.
func (*Cluster) ContextName ¶
ContextName returns the name of the kubectl configuration context for the cluster.
The kind binary autosets the context when a cluster is created. This name is also the name of the docker container created by kind that contains the entire cluster.
type Dependency ¶
type Dependency interface { // Methods for checking if the required dependency Check(context.Context) error Name() string // Methods for setting up and tearing down anything needed or produced by // the dependency Setup(context.Context) error Clean(context.Context) error }
Dependency is an interface for an external dependency required for a build function. An example of a dependency is Go, Docker, or Protoc.
type Docker ¶
Docker is a dependency check for Docker
func MustDocker ¶
type DockerImage ¶
type DockerImage struct { Name string File string Tag string Args func(context.Context) (map[string]string, error) }
func (*DockerImage) String ¶
func (i *DockerImage) String() string
type DockerRegistry ¶
type DockerRegistry struct {
// contains filtered or unexported fields
}
Docker Registry represents a dependency for creating a Docker Registry using a Docker container.
Docker must be installed on the system.
func MustDockerRegistry ¶
func MustDockerRegistry(docker *Docker) *DockerRegistry
func NewDockerRegistry ¶
func NewDockerRegistry(docker *Docker) (*DockerRegistry, error)
func (*DockerRegistry) Connect ¶
Connect attempts to connect the given registry to the specified docker network
func (*DockerRegistry) Create ¶
func (d *DockerRegistry) Create(ctx context.Context, r *Registry) (*NetworkSettings, error)
Create starts a docker registry with the given name and port combination. The ip address of the created registry is returned
If the given registry is already running it returns an error.
func (*DockerRegistry) Destroy ¶
func (d *DockerRegistry) Destroy(ctx context.Context, r *Registry) error
func (*DockerRegistry) Name ¶
func (d *DockerRegistry) Name() string
type Errors ¶
type Errors struct {
// contains filtered or unexported fields
}
Errors is a concurrency safe wrapper around uber's multierr
func (*Errors) Append ¶
Append adds the error into the underlying multierr combining all of the errors together into one error
type GoMod ¶
type GoMod struct{}
GoMod represents the `go mod` command and all of the logic associated with managing go modules
type GoTools ¶
type GoTools struct{}
GoTools represents the external tools that we download, install, and use as a part of our build pipelines.
type Golang ¶
Golang is a dependency checker for the Go language
func MustGolang ¶
func (*Golang) Build ¶
Build provides functionality for building a go binary given the pkg path of its main and a output path for the binary.
type GraphQL ¶
func NewGraphQL ¶
type Kind ¶
Kind represents a dependency on KinD (Kubernetes in Docker) which is used to create and manage our local clusters.
Kind is installed via go.mod and specified as a dependency inside of tools.go
type NetworkSettings ¶
type ParallelFunc ¶
type Registry ¶
Registry represents a docker registry managed and created by the DockerRegistry struct.
type RunnerFunc ¶
type RunnerFunc func(d Dependency) error
RunnerFunc is a function that performs an actions on a dependency