1
0
mirror of https://github.com/helm/chart-releaser.git synced 2026-02-05 09:45:23 +01:00

Fix tag pattern for index command (#24)

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
KUOKA Yusuke
2019-02-23 01:13:40 +09:00
committed by Reinhard Nägele
parent 734f43987b
commit 1b0d3e68ec

View File

@@ -84,10 +84,10 @@ func Create(config *config.Options) error {
//fmt.Printf("found release %s\n", *r.TagName)
var packageName, packageVersion, packageURL string
for _, f := range r.Assets {
tagParts := strings.Split(*r.TagName, "+")
if len(tagParts) == 2 && *f.Name == fmt.Sprintf("%s-%s.tgz", tagParts[1], tagParts[0]) {
tagParts := splitPackageNameAndVersion(*r.TagName)
if len(tagParts) == 2 && *f.Name == fmt.Sprintf("%s-%s.tgz", tagParts[0], tagParts[1]) {
p := strings.TrimSuffix(*f.Name, filepath.Ext(*f.Name))
ps := strings.Split(p, "-")
ps := splitPackageNameAndVersion(p)
packageName, packageVersion = ps[0], ps[1]
packageURL = *f.BrowserDownloadURL
@@ -109,6 +109,11 @@ func Create(config *config.Options) error {
}
func splitPackageNameAndVersion(pkg string) []string {
delimIndex := strings.LastIndex(pkg, "-")
return []string{pkg[0:delimIndex], pkg[delimIndex+1:]}
}
func addToIndexFile(indexFile *repo.IndexFile, url string) {
// fetch package to temp url so we can extract metadata and stuff
dir, err := ioutil.TempDir("", "chart-releaser")