2020-02-10 17:00:30 +00:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Package version provides the version that the binary was built at.
|
|
|
|
package version
|
|
|
|
|
2021-10-22 16:44:37 +00:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
tailscaleroot "tailscale.com"
|
|
|
|
)
|
|
|
|
|
2020-10-27 04:23:58 +00:00
|
|
|
// Long is a full version number for this build, of the form
|
|
|
|
// "x.y.z-commithash", or "date.yyyymmdd" if no actual version was
|
|
|
|
// provided.
|
2021-10-22 16:44:37 +00:00
|
|
|
var Long = "date.20211022"
|
|
|
|
|
2020-10-27 04:23:58 +00:00
|
|
|
// Short is a short version number for this build, of the form
|
|
|
|
// "x.y.z", or "date.yyyymmdd" if no actual version was provided.
|
2021-06-03 18:19:29 +00:00
|
|
|
var Short = ""
|
2020-10-27 04:23:58 +00:00
|
|
|
|
2021-06-03 18:19:29 +00:00
|
|
|
func init() {
|
2021-10-29 21:03:21 +00:00
|
|
|
// If it hasn't been link-stamped with -X (via build_dist.sh or similar),
|
|
|
|
// then use the VERSION.txt file in the root and the date in the Long
|
|
|
|
// variable above which we occasionally bump by hand.
|
2021-06-03 18:19:29 +00:00
|
|
|
if Short == "" {
|
2021-10-29 21:03:21 +00:00
|
|
|
Long = strings.TrimSpace(tailscaleroot.Version) + "-" + Long
|
2021-06-03 18:19:29 +00:00
|
|
|
Short = Long
|
|
|
|
}
|
|
|
|
}
|
2020-10-27 04:23:58 +00:00
|
|
|
|
|
|
|
// GitCommit, if non-empty, is the git commit of the
|
|
|
|
// github.com/tailscale/tailscale repository at which Tailscale was
|
|
|
|
// built. Its format is the one returned by `git describe --always
|
|
|
|
// --exclude "*" --dirty --abbrev=200`.
|
2021-06-02 08:05:13 +00:00
|
|
|
var GitCommit = ""
|
2020-10-27 04:23:58 +00:00
|
|
|
|
|
|
|
// ExtraGitCommit, if non-empty, is the git commit of a "supplemental"
|
|
|
|
// repository at which Tailscale was built. Its format is the same as
|
2020-10-28 23:29:26 +00:00
|
|
|
// gitCommit.
|
2020-10-27 04:23:58 +00:00
|
|
|
//
|
2020-10-28 23:29:26 +00:00
|
|
|
// ExtraGitCommit is used to track the source revision when the main
|
2020-10-27 04:23:58 +00:00
|
|
|
// Tailscale repository is integrated into and built from another
|
|
|
|
// repository (for example, Tailscale's proprietary code, or the
|
2020-10-28 23:29:26 +00:00
|
|
|
// Android OSS repository). Together, GitCommit and ExtraGitCommit
|
2020-10-27 04:23:58 +00:00
|
|
|
// exactly describe what repositories and commits were used in a
|
|
|
|
// build.
|
2021-06-02 08:05:13 +00:00
|
|
|
var ExtraGitCommit = ""
|