Skip to content

Commit

Permalink
Tarballs: Check if version contains build ID (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsotirakis authored Sep 28, 2023
1 parent 0cc07ff commit 71af960
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion containers/opts_grafana.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (g *GrafanaOpts) DetectVersion(ctx context.Context, client *dagger.Client,
return "", err
}

v = strings.ReplaceAll(v, "pre", "")
v = strings.ReplaceAll(v, "pre", g.BuildID)

log.Println("Got version", v)
return v, nil
Expand Down
7 changes: 6 additions & 1 deletion pipelines/package_names.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ func TarFilename(opts TarFileOpts) string {
arch = strings.Join([]string{arch, archv}, "-")
}

p := []string{name, opts.Version, opts.BuildID, os, arch}
var p []string
if strings.Contains(opts.Version, opts.BuildID) {
p = []string{name, opts.Version, os, arch}
} else {
p = []string{name, opts.Version, opts.BuildID, os, arch}
}

return fmt.Sprintf("%s.tar.gz", strings.Join(p, "_"))
}
Expand Down

0 comments on commit 71af960

Please sign in to comment.