1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-06-23 00:40:06 +02:00

fix: blob provider authentication issues for default aws mechanism (#1061)

* fix: blob provider authentication issues for default aws mechanism

* remove commented code

* docs: update the authentication doc

* fix: linter issues
This commit is contained in:
C123R
2019-06-28 13:51:19 +02:00
committed by Carlos Alexandro Becker
parent ef6e13a61b
commit ce5ade64c1
7 changed files with 63 additions and 125 deletions

View File

@ -3,6 +3,7 @@ package blob
import (
"fmt"
"strings"
"github.com/goreleaser/goreleaser/internal/pipe"
"github.com/goreleaser/goreleaser/internal/semerrgroup"
@ -34,13 +35,6 @@ func (Pipe) Default(ctx *context.Context) error {
if blob.Folder == "" {
blob.Folder = "{{ .ProjectName }}/{{ .Tag }}"
}
// Validation before opening connection to bucket
// gocdk also does this validation but doing it in advance for better error handling
// as currently, go cdk does not throw error if AZURE_STORAGE_KEY is missing.
err := checkProvider(blob.Provider)
if err != nil {
return err
}
}
return nil
}
@ -66,3 +60,13 @@ func (Pipe) Publish(ctx *context.Context) error {
}
return g.Wait()
}
// errorContains check if error contains specific string
func errorContains(err error, subs ...string) bool {
for _, sub := range subs {
if strings.Contains(err.Error(), sub) {
return true
}
}
return false
}