Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages: Remove pre string from package names #184

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pipelines/package_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func TarFilename(opts TarFileOpts) string {
arch = strings.Join([]string{arch, archv}, "-")
}

p := []string{name, opts.Version, opts.BuildID, os, arch}
versionTrimmed := strings.TrimSuffix(opts.Version, "-pre")
p := []string{name, versionTrimmed, opts.BuildID, os, arch}

return fmt.Sprintf("%s.tar.gz", strings.Join(p, "_"))
}
Expand Down
14 changes: 14 additions & 0 deletions pipelines/package_names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ func TestTarFilename(t *testing.T) {
t.Errorf("name '%s' does not match expected name '%s'", name, expected)
}
})
t.Run("It should use the correct name if Enterprise is false", func(t *testing.T) {
distro := executil.Distribution("plan9/amd64")
opts := pipelines.TarFileOpts{
Edition: "",
Version: "v1.0.1-pre",
BuildID: "333",
Distro: distro,
}

expected := "grafana_v1.0.1_333_plan9_amd64.tar.gz"
if name := pipelines.TarFilename(opts); name != expected {
t.Errorf("name '%s' does not match expected name '%s'", name, expected)
}
})
t.Run("It should use the correct name if Enterprise is true", func(t *testing.T) {
distro := executil.Distribution("plan9/amd64")
opts := pipelines.TarFileOpts{
Expand Down