Documentation ¶
Index ¶
- Variables
- func FullVersion(tag string, bt BuildType) (string, error)
- func GetBaseVersion(tag string, bt BuildType) (string, error)
- func GetPrereleaseVersion(tag string, bt BuildType) (string, error)
- func GetVersion(tag string, bt BuildType) (string, error)
- func Iteration(tag string, bt BuildType) (string, error)
- func Semver() string
- type BuildEnv
- type BuildType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version stores the version of the current build (e.g. 2.0.0) Version = "" // PreReleaseIdentifier stores the pre-release identifier of the current // build (e.g. the 2 in beta-2) PreReleaseIdentifier string // BuildDate stores the timestamp of the build // (e.g. 2017-07-31T13:11:15-0700) BuildDate string // BuildSHA stores the git sha of the build // (e.g. 8673bed0a9705083987b9ecbbc1cc0758df13dd2) BuildSHA string )
These values are baked into the sensu-agent and sensu-backend binaries during compilation, and are accessed using the Semver() function
View Source
var ( ErrNoBuildIteration = errors.New("Build iteration could not be found. If running locally you must set SENSU_BUILD_ITERATION.") ErrTagParse = errors.New("A build iteration could not be parsed from the tag") )
Functions ¶
func FullVersion ¶
FullVersion will output the version of the build (with iteration) (e.g. "2.0.0-alpha.17-1")
func GetBaseVersion ¶
GetBaseVersion will output the major, minor, and patch #s with dots. (e.g. "2.0.1")
func GetPrereleaseVersion ¶
GetPrereleaseVersion will output the version of a prerelease from its tag (e.g. "17" from tag "2.0.0-alpha.17")
func GetVersion ¶
GetVersion will output the version of the build (without iteration) (e.g. "2.0.0-alpha.17")
Types ¶
type BuildEnv ¶
type BuildEnv interface { IsCI() bool IsNightly() (bool, error) GetMostRecentTag() (string, error) }
BuildEnv provides methods for determining version info from the current env.
Click to show internal directories.
Click to hide internal directories.