add the git sha to the server.
parent
ff62ab4423
commit
07b7fab981
|
@ -69,7 +69,8 @@ function build_packages {
|
|||
|
||||
function setup_version {
|
||||
echo "Changing version from dev to $influxdb_version"
|
||||
sed -i.bak "s/var version = \"dev\"/var version = \"$influxdb_version\"/" src/server/server.go
|
||||
sha1=`git rev-list --max-count=1 HEAD`
|
||||
sed -i.bak -e "s/var version = \"dev\"/var version = \"$influxdb_version\"/" -e "s/var gitSha = \"\"/var gitSha = \"$sha1\"/" src/server/server.go
|
||||
}
|
||||
|
||||
function revert_version {
|
||||
|
|
|
@ -18,13 +18,14 @@ var fileName = flag.String("config", "config.json.sample", "Config file")
|
|||
var wantsVersion = flag.Bool("version", false, "Get version number")
|
||||
|
||||
var version = "dev"
|
||||
var gitSha = ""
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
flag.Parse()
|
||||
|
||||
if wantsVersion != nil && *wantsVersion {
|
||||
fmt.Printf("InfluxDB v%s\n", version)
|
||||
fmt.Printf("InfluxDB v%s (git: %s)\n", version, gitSha)
|
||||
return
|
||||
}
|
||||
config := configuration.LoadConfiguration(*fileName)
|
||||
|
|
Loading…
Reference in New Issue