mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
a9497f0a96
commit
5bb0d26604
33
build.go
33
build.go
@ -64,6 +64,10 @@ func main() {
|
|||||||
|
|
||||||
readVersionFromPackageJson()
|
readVersionFromPackageJson()
|
||||||
|
|
||||||
|
if pkgArch == "" {
|
||||||
|
pkgArch = goarch
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
|
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
|
||||||
|
|
||||||
if flag.NArg() == 0 {
|
if flag.NArg() == 0 {
|
||||||
@ -105,10 +109,17 @@ func main() {
|
|||||||
|
|
||||||
case "package":
|
case "package":
|
||||||
grunt(gruntBuildArg("build")...)
|
grunt(gruntBuildArg("build")...)
|
||||||
packageGrafana()
|
grunt(gruntBuildArg("package")...)
|
||||||
|
if goos == "linux" {
|
||||||
|
createLinuxPackages()
|
||||||
|
}
|
||||||
|
|
||||||
case "package-only":
|
case "package-only":
|
||||||
packageGrafana()
|
grunt(gruntBuildArg("package")...)
|
||||||
|
if goos == "linux" {
|
||||||
|
createLinuxPackages()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
case "pkg-rpm":
|
case "pkg-rpm":
|
||||||
grunt(gruntBuildArg("release")...)
|
grunt(gruntBuildArg("release")...)
|
||||||
@ -133,22 +144,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func packageGrafana() {
|
|
||||||
platformArg := fmt.Sprintf("--platform=%v", goos)
|
|
||||||
previousPkgArch := pkgArch
|
|
||||||
if pkgArch == "" {
|
|
||||||
pkgArch = goarch
|
|
||||||
}
|
|
||||||
postProcessArgs := gruntBuildArg("package")
|
|
||||||
postProcessArgs = append(postProcessArgs, platformArg)
|
|
||||||
grunt(postProcessArgs...)
|
|
||||||
pkgArch = previousPkgArch
|
|
||||||
|
|
||||||
if goos == "linux" {
|
|
||||||
createLinuxPackages()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func makeLatestDistCopies() {
|
func makeLatestDistCopies() {
|
||||||
files, err := ioutil.ReadDir("dist")
|
files, err := ioutil.ReadDir("dist")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -404,6 +399,8 @@ func gruntBuildArg(task string) []string {
|
|||||||
if phjsToRelease != "" {
|
if phjsToRelease != "" {
|
||||||
args = append(args, fmt.Sprintf("--phjsToRelease=%v", phjsToRelease))
|
args = append(args, fmt.Sprintf("--phjsToRelease=%v", phjsToRelease))
|
||||||
}
|
}
|
||||||
|
args = append(args, fmt.Sprintf("--platform=%v", goos))
|
||||||
|
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user