Add version command
Created by: efritz
Changes:
- Supply buildTag value to source via
git describe --tags
at build time in CI - Add version command that prints current buildTag and hits the current SG instance to display the recommended version
$ go build -ldflags="-X 'main.buildTag=`git describe --tags`'" ./cmd/src
$ ./src version
Current version: 3.9.0-19-gfa72eb8e1bf6
./srRecommended Version: <unknown>
This Sourcegraph instance does not support this feature.
$ ./src -endpoint http://localhost:3080 version
Current version: 3.9.0-19-gfa72eb8e1bf6
Recommended Version: 3.9.0
Note that "dev" is the buildTag if no ldflags are supplied.