From 7d01a5a8a49dcd6c2e7c5cf4165635ec47fae409 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 1 Jul 2017 12:30:24 -0300 Subject: [PATCH] renamed archives to binaries, pointed more changes --- context/context.go | 9 +++++---- pipeline/archive/archive.go | 3 ++- pipeline/brew/brew.go | 3 ++- pipeline/fpm/fpm.go | 6 ++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/context/context.go b/context/context.go index cf92af2f6..26dcd6669 100644 --- a/context/context.go +++ b/context/context.go @@ -27,7 +27,7 @@ type Context struct { Config config.Project Token string Git GitInfo - Archives map[string]string + Binaries map[string]string Artifacts []string ReleaseNotes string Version string @@ -49,11 +49,12 @@ func (ctx *Context) AddArtifact(file string) { log.WithField("artifact", file).Info("registered") } -func (ctx *Context) AddArchive(key, file string) { +// AddBinary adds a built binary to the current context +func (ctx *Context) AddBinary(key, file string) { archiveLock.Lock() defer archiveLock.Unlock() - ctx.Archives[key] = file - log.WithField("key", key).WithField("archive", file).Info("added") + ctx.Binaries[key] = file + log.WithField("key", key).WithField("binary", file).Info("added") } // New context diff --git a/pipeline/archive/archive.go b/pipeline/archive/archive.go index 49fda5440..ec7a67a6d 100644 --- a/pipeline/archive/archive.go +++ b/pipeline/archive/archive.go @@ -27,7 +27,8 @@ func (Pipe) Description() string { // Run the pipe func (Pipe) Run(ctx *context.Context) error { var g errgroup.Group - for platform, archive := range ctx.Archives { + // TODO: fix here + for platform, archive := range ctx.Binaries { archive := archive platform := platform g.Go(func() error { diff --git a/pipeline/brew/brew.go b/pipeline/brew/brew.go index 663bf7960..5aa6824b4 100644 --- a/pipeline/brew/brew.go +++ b/pipeline/brew/brew.go @@ -135,7 +135,8 @@ func doBuildFormula(data templateData) (bytes.Buffer, error) { } func hasDarwinBuilds(ctx *context.Context) bool { - for key := range ctx.Archives { + // TODO: fix here + for key := range ctx.Binaries { if strings.HasSuffix(key, "darwinamd64") { return true } diff --git a/pipeline/fpm/fpm.go b/pipeline/fpm/fpm.go index 4fafc846d..7745b2b8e 100644 --- a/pipeline/fpm/fpm.go +++ b/pipeline/fpm/fpm.go @@ -44,11 +44,13 @@ func (Pipe) Run(ctx *context.Context) error { for _, build := range ctx.Config.Builds { for _, goarch := range build.Goarch { var key = build.Binary + "linux" + goarch - if ctx.Archives[key] == "" { + // TODO: fix here + if ctx.Binaries[key] == "" { continue } format := format - archive := ctx.Archives[key] + // TODO: fix here + archive := ctx.Binaries[key] arch := goarchToUnix[goarch] g.Go(func() error { return create(ctx, format, archive, arch)