mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 10:16:32 +00:00
Added -version flag to watchdog
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>
This commit is contained in:
18
watchdog/version.go
Normal file
18
watchdog/version.go
Normal file
@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user