mirror of https://github.com/grafana/grafana.git
Build: Add -buildvcs=false flag to go build
This commit is contained in:
parent
4682a288a3
commit
ecbe0bdaf6
|
@ -203,6 +203,10 @@ func doBuild(binaryName, pkg string, opts BuildOpts) error {
|
|||
args = append(args, "-race")
|
||||
}
|
||||
|
||||
// We should not publish Grafana as a Go module, disabling vcs changes the version to (devel)
|
||||
// and works better with SBOM and Vulnerability Scanners.
|
||||
args = append(args, "-buildvcs=false")
|
||||
|
||||
args = append(args, "-o", binary)
|
||||
args = append(args, pkg)
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@ func GoLDFlags(flags []LDFlag) string {
|
|||
// GoBuildCommand returns the arguments for go build to be used in 'WithExec'.
|
||||
func GoBuildCommand(output string, ldflags []LDFlag, tags []string, main string) []string {
|
||||
args := []string{"go", "build",
|
||||
// We should not publish Grafana as a Go module, disabling vcs changes the version to (devel)
|
||||
// and works better with SBOM and Vulnerability Scanners.
|
||||
"-buildvcs=false",
|
||||
fmt.Sprintf("-ldflags=\"%s\"", GoLDFlags(ldflags)),
|
||||
fmt.Sprintf("-o=%s", output),
|
||||
"-trimpath",
|
||||
|
|
Loading…
Reference in New Issue