build: refactoring

This commit is contained in:
Leonard Gram
2019-03-24 00:43:36 +01:00
parent 768c7b6f4a
commit f0c6a480cd
2 changed files with 11 additions and 13 deletions

View File

@ -342,7 +342,7 @@ jobs:
name: Deploy to grafana.com name: Deploy to grafana.com
command: | command: |
cd enterprise-dist cd enterprise-dist
../scripts/build/release_publisher/release_publisher -apikey ${GRAFANA_COM_API_KEY} -enterprise -version "$(cat grafana.version)"' --nightly ../scripts/build/release_publisher/release_publisher -apikey ${GRAFANA_COM_API_KEY} -enterprise -version "$(cat grafana.version)" --nightly
deploy-enterprise-release: deploy-enterprise-release:

View File

@ -421,13 +421,17 @@ func grunt(params ...string) {
} }
} }
func genPackageVersion() string {
if includeBuildId {
return fmt.Sprintf("%v-%v", linuxPackageVersion, linuxPackageIteration)
} else {
return version
}
}
func gruntBuildArg(task string) []string { func gruntBuildArg(task string) []string {
args := []string{task} args := []string{task}
if includeBuildId { args = append(args, fmt.Sprintf("--pkgVer=%v", genPackageVersion()))
args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration))
} else {
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))
} }
@ -449,13 +453,7 @@ func setup() {
} }
func printGeneratedVersion() { func printGeneratedVersion() {
var genVersion string fmt.Print(genPackageVersion())
if includeBuildId {
genVersion = fmt.Sprintf("%v-%v", linuxPackageVersion, linuxPackageIteration)
} else {
genVersion = version
}
fmt.Print(genVersion)
} }
func test(pkg string) { func test(pkg string) {