mirror of
https://github.com/openfaas/faas.git
synced 2025-06-10 01:06:47 +00:00
This changes introduces a new flag -version to watchdog which will display version and SHA of last git commit. Version and SHA are injected at build time and passed as a build-args for Dockerfile. Fixes: #632 Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
19 lines
354 B
Go
19 lines
354 B
Go
package main
|
|
|
|
var (
|
|
//Version release version of the watchdog
|
|
Version string
|
|
//GitCommit SHA of the last git commit
|
|
GitCommit string
|
|
//DevVerison string for the development version
|
|
DevVerison = "dev"
|
|
)
|
|
|
|
//BuildVersion returns current version of watchdog
|
|
func BuildVersion() string {
|
|
if len(Version) == 0 {
|
|
return DevVerison
|
|
}
|
|
return Version
|
|
}
|