version: use OSS repo's version when building.

When building with redo, also include the git commit hash
from the proprietary repo, so that we have a precise commit
that identifies all build info (including Go toolchain version).

Add a top-level build script demonstrating to downstream distros
how to burn the right information into builds.

Adjust `tailscale version` to print commit hashes when available.

Fixes #841.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-10-27 04:23:58 +00:00
committed by Dave Anderson
parent a1ccaa9658
commit 54e6c3a290
26 changed files with 224 additions and 65 deletions

View File

@@ -36,10 +36,11 @@ func runVersion(ctx context.Context, args []string) error {
log.Fatalf("too many non-flag arguments: %q", args)
}
if !versionArgs.daemon {
fmt.Println(version.LONG)
fmt.Println(version.String())
return nil
}
fmt.Printf("Client: %s\n", version.LONG)
fmt.Printf("Client: %s\n", version.String())
c, bc, ctx, cancel := connect(ctx)
defer cancel()