mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-08 12:15:13 +02:00
ci on canary build, version should show "0.0.0-dev" Signed-off-by: Quan TRAN <account@itscaro.me>
29 lines
487 B
Go
29 lines
487 B
Go
// Package version is used to get the version of the Helmfile CLI.
|
|
package version
|
|
|
|
import "fmt"
|
|
|
|
// Version is the version of Helmfile
|
|
var Version string
|
|
|
|
// Commit is the git revision
|
|
var Commit string
|
|
|
|
func GetVersion() string {
|
|
if Version == "" {
|
|
Version = "0.0.0-dev"
|
|
}
|
|
return Version
|
|
}
|
|
|
|
func GetCommit() string {
|
|
if Commit == "" {
|
|
Commit = "unknown_commit"
|
|
}
|
|
return Commit
|
|
}
|
|
|
|
func GetVersionWithCommit() string {
|
|
return fmt.Sprintf("%s-%s", GetVersion(), GetCommit())
|
|
}
|