build

package
v1.0.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildSelectionEnvVar = "EMPIRICA_BUILD"
	DebugBuildEnvVar     = "EMPIRICA_DEBUG_BUILD"
	DownloadRootEnvVar   = "EMPIRICA_DOWNLOAD_ROOT"
)

Variables

View Source
var (
	ErrBuildMissing = errors.New("build info missing")
	ErrBuildEmpty   = errors.New("build info empty")
)
View Source
var Branch string

Branch holds the git branch of the build.

View Source
var BuildNum string

BuildNum holds the build build (123).

View Source
var Commit string

Commit holds the build Git commit SHA1.

View Source
var DevBuild string

DevBuild is "true" if this is a development build.

View Source
var ErrBuildNotFound = errors.New("build version not found")
View Source
var ErrEmptyBuild = errors.New("empty build")

Tag holds the git tag of the build.

View Source
var Time string

Time holds the build time.

Functions

func BinaryURL

func BinaryURL(build *Build) (*url.URL, error)

func DownloadBinary

func DownloadBinary(build *Build, fileName string) error

func DownloadRoot

func DownloadRoot() string

func LookupBinary

func LookupBinary() (string, error)

func ReleaseFilePath

func ReleaseFilePath() string

func SaveReleaseFile

func SaveReleaseFile(dir string) error

func Version

func Version() string

Version return the build version (vX.Y.Z) at build time. Returns "" if this build was not a tagged version.

func VersionString

func VersionString() string

Types

type Build

type Build struct {
	DevBuild string `json:"dev,omitempty" yaml:"dev,omitempty"`
	Version  string `json:"version,omitempty" yaml:"version,omitempty"`
	Tag      string `json:"tag,omitempty" yaml:"tag,omitempty"`
	Commit   string `json:"commit,omitempty" yaml:"commit,omitempty"`
	BuildNum string `json:"build,omitempty" yaml:"build,omitempty"`
	Branch   string `json:"branch,omitempty" yaml:"branch,omitempty"`
	Time     string `json:"time,omitempty" yaml:"time,omitempty"`
	// contains filtered or unexported fields
}

func BinaryVersion

func BinaryVersion() (*Build, error)

BinaryVersion returns which binary version should be used. It will first use the environement variable override, then try to look for the version lock file inside a project.

func Current

func Current() *Build

func (*Build) Empty

func (b *Build) Empty() bool

func (*Build) String

func (b *Build) String() string

func (*Build) VersionComponents

func (b *Build) VersionComponents() (components []string, err error)

VersionComponents returns the most important key and value of of the build. This allows identification of a build by different attributes, with the following precedence: - version - commit - build - tag - branch.

Jump to

Keyboard shortcuts

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