mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-30 05:59:39 +02:00
fix(helmExecute): do not publish helm charts under subfolders (#4065)
This commit is contained in:
parent
a055b905f9
commit
959fa964b1
@ -426,9 +426,7 @@ func (h *HelmExecute) RunHelmPublish() (string, error) {
|
||||
|
||||
h.utils.SetOptions(repoClientOptions)
|
||||
|
||||
binary := fmt.Sprintf("%v", h.config.DeploymentName+"-"+h.config.PublishVersion+".tgz")
|
||||
|
||||
targetPath := fmt.Sprintf("%v/%s", h.config.DeploymentName, binary)
|
||||
binary := fmt.Sprintf("%s-%s.tgz", h.config.DeploymentName, h.config.PublishVersion)
|
||||
|
||||
separator := "/"
|
||||
|
||||
@ -436,7 +434,7 @@ func (h *HelmExecute) RunHelmPublish() (string, error) {
|
||||
separator = ""
|
||||
}
|
||||
|
||||
targetURL := fmt.Sprintf("%s%s%s", h.config.TargetRepositoryURL, separator, targetPath)
|
||||
targetURL := fmt.Sprintf("%s%s%s", h.config.TargetRepositoryURL, separator, binary)
|
||||
|
||||
log.Entry().Infof("publishing artifact: %s", targetURL)
|
||||
|
||||
|
@ -540,8 +540,8 @@ func TestRunHelmPublish(t *testing.T) {
|
||||
targetURL, err := helmExecute.RunHelmPublish()
|
||||
if assert.NoError(t, err) {
|
||||
assert.Equal(t, 1, len(utils.FileUploads))
|
||||
assert.Equal(t, "https://my.target.repository.local/test_helm_chart/test_helm_chart-1.2.3.tgz", targetURL)
|
||||
assert.Equal(t, "https://my.target.repository.local/test_helm_chart/test_helm_chart-1.2.3.tgz", utils.FileUploads["test_helm_chart-1.2.3.tgz"])
|
||||
assert.Equal(t, "https://my.target.repository.local/test_helm_chart-1.2.3.tgz", targetURL)
|
||||
assert.Equal(t, "https://my.target.repository.local/test_helm_chart-1.2.3.tgz", utils.FileUploads["test_helm_chart-1.2.3.tgz"])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user