mirror of
https://github.com/grafana/grafana.git
synced 2026-02-03 20:49:50 -05:00
fix: modify the grafana dev build (#116872)
* ale/debug * undo change and ignore local cert * fix flag * cleanup
This commit is contained in:
parent
fda39b0c26
commit
86f6f7657a
4 changed files with 12 additions and 5 deletions
|
|
@ -5,6 +5,7 @@
|
|||
.vscode
|
||||
bin
|
||||
!bin/grafana-linux-k8s
|
||||
!bin/grafana-linux-k8s-debug
|
||||
data*
|
||||
dist
|
||||
docker
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -264,3 +264,4 @@ public/mockServiceWorker.js
|
|||
.hippo
|
||||
|
||||
coverage-summary.json
|
||||
devenv/blocks/auth/signer/keys/ec_private_key.pem
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ func RunCmd() int {
|
|||
}
|
||||
|
||||
case "build":
|
||||
//clean()
|
||||
// clean()
|
||||
for _, binary := range binaries {
|
||||
log.Println("building binaries", cmd)
|
||||
// Can't use filepath.Join here because filepath.Join calls filepath.Clean, which removes the `./` from this path, which upsets `go build`
|
||||
|
|
@ -154,6 +154,10 @@ func setup(goos string) {
|
|||
}
|
||||
|
||||
func doBuild(binaryName, pkg string, opts BuildOpts) error {
|
||||
if opts.binarySuffix != "" {
|
||||
binaryName += "-" + opts.binarySuffix
|
||||
}
|
||||
|
||||
log.Println("building", binaryName, pkg)
|
||||
|
||||
if err := setBuildEnv(opts); err != nil {
|
||||
|
|
@ -166,7 +170,7 @@ func doBuild(binaryName, pkg string, opts BuildOpts) error {
|
|||
}
|
||||
binary := fmt.Sprintf("./bin/%s", binaryName)
|
||||
|
||||
//don't include os/arch/libc in output path in dev environment
|
||||
// don't include os/arch/libc in output path in dev environment
|
||||
if !opts.isDev {
|
||||
binary = fmt.Sprintf("./bin/%s-%s%s/%s", opts.goos, opts.goarch, libcPart, binaryName)
|
||||
}
|
||||
|
|
@ -289,9 +293,8 @@ func setBuildEnv(opts BuildOpts) error {
|
|||
}
|
||||
}
|
||||
|
||||
if (opts.goos != GoOSLinux || opts.goarch != "amd64") &&
|
||||
opts.goos != GoOSDarwin {
|
||||
// needed for archs other than linux/amd64 and darwin/arm64 + darwin/amd64
|
||||
if opts.goos != GoOSLinux && opts.goos != GoOSDarwin {
|
||||
// needed for archs other than linux/amd64, linux/arm64, darwin/arm64 and darwin/amd64
|
||||
opts.cgo = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ type BuildOpts struct {
|
|||
skipRpmGen bool
|
||||
skipDebGen bool
|
||||
printGenVersion bool
|
||||
binarySuffix string
|
||||
}
|
||||
|
||||
// BuildOptsFromFlags reads the cmd args to assemble a BuildOpts object. This function calls flag.Parse()
|
||||
|
|
@ -50,6 +51,7 @@ func BuildOptsFromFlags() BuildOpts {
|
|||
flag.BoolVar(&opts.skipRpmGen, "skipRpm", false, "skip rpm package generation (default: false)")
|
||||
flag.BoolVar(&opts.skipDebGen, "skipDeb", false, "skip deb package generation (default: false)")
|
||||
flag.BoolVar(&opts.printGenVersion, "gen-version", false, "generate Grafana version and output (default: false)")
|
||||
flag.StringVar(&opts.binarySuffix, "suffix", "", "suffix to append to binary name")
|
||||
flag.Parse()
|
||||
|
||||
opts.buildID = shortenBuildID(buildIDRaw)
|
||||
|
|
|
|||
Loading…
Reference in a new issue