X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8d24a8224decd26726dcfdeb239df4e12bd0d315..09a1ecf507df8ca110e6620efeb3593bc0d90192:/services/arv-git-httpd/main.go diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go index 79a3eb3f7b..74ac7ae55e 100644 --- a/services/arv-git-httpd/main.go +++ b/services/arv-git-httpd/main.go @@ -7,6 +7,7 @@ package main import ( "encoding/json" "flag" + "fmt" "log" "os" "regexp" @@ -16,6 +17,8 @@ import ( "github.com/coreos/go-systemd/daemon" ) +var version = "dev" + // Server configuration type Config struct { Client arvados.Client @@ -50,6 +53,7 @@ func main() { cfgPath := flag.String("config", defaultCfgPath, "Configuration file `path`.") dumpConfig := flag.Bool("dump-config", false, "write current configuration to stdout and exit (useful for migrating from command line flags to config file)") + getVersion := flag.Bool("version", false, "print version information and exit.") flag.StringVar(&theConfig.ManagementToken, "management-token", theConfig.ManagementToken, "Authorization token to be included in all health check requests.") @@ -57,6 +61,12 @@ func main() { flag.Usage = usage flag.Parse() + // Print version information if requested + if *getVersion { + fmt.Printf("arv-git-httpd %s\n", version) + return + } + err := config.LoadFile(theConfig, *cfgPath) if err != nil { h := os.Getenv("ARVADOS_API_HOST") @@ -84,6 +94,7 @@ func main() { if _, err := daemon.SdNotify(false, "READY=1"); err != nil { log.Printf("Error notifying init daemon: %v", err) } + log.Printf("arv-git-httpd %s started", version) log.Println("Listening at", srv.Addr) log.Println("Repository root", theConfig.RepoRoot) if err := srv.Wait(); err != nil {