Commit 1631c8de by bergquist

build: use correct version for tar.gz files

parent a763285d
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"path"
) )
var ( var (
...@@ -120,14 +121,24 @@ func main() { ...@@ -120,14 +121,24 @@ func main() {
} }
func makeLatestDistCopies() { func makeLatestDistCopies() {
rpmIteration := "-1" files, err := ioutil.ReadDir("dist")
if linuxPackageIteration != "" { if err != nil {
rpmIteration = linuxPackageIteration log.Fatalf("failed to create latest copies. Cannot read from /dist")
}
latestMapping := map[string]string {
".deb": "dist/grafana_latest_amd64.deb",
".rpm": "dist/grafana-latest-1.x86_64.rpm",
".tar.gz": "dist/grafana-latest.linux-x64.tar.gz",
} }
runError("cp", fmt.Sprintf("dist/grafana_%v-%v_amd64.deb", linuxPackageVersion, linuxPackageIteration), "dist/grafana_latest_amd64.deb") for _, file := range files {
runError("cp", fmt.Sprintf("dist/grafana-%v-%v.x86_64.rpm", linuxPackageVersion, rpmIteration), "dist/grafana-latest-1.x86_64.rpm") for extension, fullName := range latestMapping {
runError("cp", fmt.Sprintf("dist/grafana-%v-%v.linux-x64.tar.gz", linuxPackageVersion, linuxPackageIteration), "dist/grafana-latest.linux-x64.tar.gz") if strings.HasSuffix(file.Name(), extension) {
runError("cp", path.Join("dist", file.Name()), fullName)
}
}
}
} }
func readVersionFromPackageJson() { func readVersionFromPackageJson() {
...@@ -332,9 +343,9 @@ func grunt(params ...string) { ...@@ -332,9 +343,9 @@ func grunt(params ...string) {
func gruntBuildArg(task string) []string { func gruntBuildArg(task string) []string {
args := []string{task} args := []string{task}
if includeBuildNumber { if includeBuildNumber {
args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration)) args = append(args, fmt.Sprintf("--pkgVer=%v-%v", version, linuxPackageIteration))
} else { } else {
args = append(args, fmt.Sprintf("--pkgVer=%v", linuxPackageVersion)) args = append(args, fmt.Sprintf("--pkgVer=%v", version))
} }
if pkgArch != "" { if pkgArch != "" {
args = append(args, fmt.Sprintf("--arch=%v", pkgArch)) args = append(args, fmt.Sprintf("--arch=%v", pkgArch))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment