Skip to content

Commit

Permalink
fix move packages for pro-rpi (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
kminehart authored Aug 31, 2023
1 parent 0dd80ff commit c5d99cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/move_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

const (
proName = "enterprise2"
// 1: The version (with a v prefix)
// 2: The "edition". Options: 'oss', 'pro', 'enterprise'.
// 3: The full name. 'grafana', 'grafana-enterprise', 'grafana-pro
Expand Down Expand Up @@ -128,7 +129,7 @@ func RPMHandler(name string) []string {
if edition == "pro" {
// "pro" in this case is called "enterprise2"
fullName = "grafana-enterprise2"
edition = "enterprise2"
edition = proName
// and is in the 'downloads-enterprise2' folder instead of 'downloads'
enterprise2 = "-enterprise2"
// and has an period separator {version}.{arch} instead of {version}_{arch}
Expand Down Expand Up @@ -181,7 +182,15 @@ func DebHandler(name string) []string {
if edition == "pro" {
// "pro" in this case is called "enterprise2"
fullName = "grafana-enterprise2"
edition = "enterprise2"
edition = proName
// and is in the 'downloads-enterprise2' folder instead of 'downloads'
enterprise2 = "-enterprise2"
}

if edition == "pro-rpi" {
// "pro" in this case is called "enterprise2"
fullName = "grafana-enterprise2-rpi"
edition = proName
// and is in the 'downloads-enterprise2' folder instead of 'downloads'
enterprise2 = "-enterprise2"
}
Expand Down Expand Up @@ -239,7 +248,7 @@ func TarGZHandler(name string) []string {
if edition == "pro" {
enterprise2 = "-enterprise2"
fullName = "grafana-enterprise2"
edition = "enterprise2"
edition = proName
}
}

Expand Down Expand Up @@ -292,7 +301,7 @@ func DockerHandler(name string) []string {
if opts.Edition != "" {
edition = opts.Edition
if edition == "pro" {
edition = "enterprise2"
edition = proName
}
}

Expand Down
6 changes: 6 additions & 0 deletions scripts/move_packages_deb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ var debMapping = []m{
"artifacts/downloads/v1.2.3/enterprise/release/grafana-enterprise_1.2.3_armhf.deb.sha256",
},
},
{
input: "gs://bucket/tag/grafana-pro-rpi_v1.2.3_102_linux_arm-7.deb",
output: []string{
"artifacts/downloads-enterprise2/v1.2.3/enterprise2/release/grafana-enterprise2-rpi_1.2.3_armhf.deb",
},
},
{
input: "gs://bucket/tag/grafana-pro_v1.2.3-pre.4_102_linux_amd64.deb",
output: []string{
Expand Down

0 comments on commit c5d99cf

Please sign in to comment.