ctx

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: BlueOak-1.0.0 Imports: 4 Imported by: 1

Documentation

Overview

ctx provides a cumulative structure carried over to each module in the build pipeline.

Index

Constants

This section is empty.

Variables

View Source
var Info = &info{}

Functions

func New

func New(ctx context.Context) context.Context

Types

type Artifact

type Artifact struct {
	Arch       string
	ArchName   string
	ArmVersion int32
	Filename   string
	ID         string
	Location   string
	OS         string
}

Artifact is a file generated by the build pipeline, which can be further processed by later steps (eg. a build result put into an archive)

func (*Artifact) OsArch

func (art *Artifact) OsArch() string

OsArch returns artifact's os-arch string

type Artifacts

type Artifacts []*Artifact

Artifacts is a slice of Artifact

func (*Artifacts) Add

func (arts *Artifacts) Add(artifact *Artifact)

Add registers a new artifact in Artifacts

func (*Artifacts) ByID

func (arts *Artifacts) ByID(id string) *Artifacts

ByID searches artifacts by their build IDs

func (*Artifacts) OsArchByIDs

func (arts *Artifacts) OsArchByIDs(ids []string, skips []string) map[string]*Artifacts

OsArchByIDs maps artifacts by OS-Arch, filtering by IDs

type Context

type Context struct {
	context.Context
	Artifacts   Artifacts
	Env         *withenv.Env
	Git         *GitData
	ProjectName string
	Publish     bool
	TargetDir   string
	Version     string
}

Context are a cumulative structure carried over to each module, to contain data later steps might require

func GetShipContext

func GetShipContext(cx context.Context) (*Context, error)

GetShipContext returns *ctx.Context from context.Context

type GitData

type GitData struct {
	// Tag contains git tag information, if the repo is on a specific tag
	Tag string
	// Ref contains the full SHA1 checksum of the current commit
	Ref string
	// URL contains git repo's URL, collected from current branch's upstream
	URL string
}

GitData contains git-specific information on the repository

Jump to

Keyboard shortcuts

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