From 3ce5a430ee485f176e57c9e78b91ac9df2cc35d2 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 25 Mar 2017 21:31:16 -0300 Subject: [PATCH] renamed --- config/config.go | 2 +- pipeline/archive/archive.go | 2 +- pipeline/brew/brew.go | 2 +- pipeline/build/build.go | 2 +- pipeline/build/build_test.go | 2 +- pipeline/defaults/defaults.go | 2 +- pipeline/fpm/fpm.go | 2 +- pipeline/release/release.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/config.go b/config/config.go index 103f01ddb..8dd767a02 100644 --- a/config/config.go +++ b/config/config.go @@ -77,7 +77,7 @@ type Project struct { FPM FPM `yaml:"fpm"` // test only property: - TargetFolder string `yaml:"-"` + Dist string `yaml:"-"` } // Load config file diff --git a/pipeline/archive/archive.go b/pipeline/archive/archive.go index 2f494b2ac..2ecf5f580 100644 --- a/pipeline/archive/archive.go +++ b/pipeline/archive/archive.go @@ -39,7 +39,7 @@ type Archive interface { } func create(name string, ctx *context.Context) error { - folder := filepath.Join(ctx.Config.TargetFolder, name) + folder := filepath.Join(ctx.Config.Dist, name) file, err := os.Create(folder + "." + ctx.Config.Archive.Format) log.Println("Creating", file.Name()) if err != nil { diff --git a/pipeline/brew/brew.go b/pipeline/brew/brew.go index d898305f2..6f282f9e7 100644 --- a/pipeline/brew/brew.go +++ b/pipeline/brew/brew.go @@ -188,7 +188,7 @@ func dataFor( } sum, err := sha256sum.For( filepath.Join( - ctx.Config.TargetFolder, + ctx.Config.Dist, file+"."+ctx.Config.Archive.Format, ), ) diff --git a/pipeline/build/build.go b/pipeline/build/build.go index 1103a2052..7f36c08a0 100644 --- a/pipeline/build/build.go +++ b/pipeline/build/build.go @@ -64,7 +64,7 @@ func (Pipe) Run(ctx *context.Context) error { func build(name, goos, goarch string, ctx *context.Context) error { ldflags := ctx.Config.Build.Ldflags + " -X main.version=" + ctx.Version output := filepath.Join( - ctx.Config.TargetFolder, + ctx.Config.Dist, name, ctx.Config.Build.Binary+extFor(goos), ) diff --git a/pipeline/build/build_test.go b/pipeline/build/build_test.go index badc096ed..081a61860 100644 --- a/pipeline/build/build_test.go +++ b/pipeline/build/build_test.go @@ -46,7 +46,7 @@ func TestRunFullPipe(t *testing.T) { var pre = filepath.Join(folder, "pre") var post = filepath.Join(folder, "post") var config = config.Project{ - TargetFolder: folder, + Dist: folder, Build: config.Build{ Binary: "testing", Flags: "-v", diff --git a/pipeline/defaults/defaults.go b/pipeline/defaults/defaults.go index c876b9ee8..1d15c08e2 100644 --- a/pipeline/defaults/defaults.go +++ b/pipeline/defaults/defaults.go @@ -82,7 +82,7 @@ func (Pipe) Run(ctx *context.Context) error { if ctx.Config.Brew.Install == "" { ctx.Config.Brew.Install = "bin.install \"" + ctx.Config.Build.Binary + "\"" } - ctx.Config.TargetFolder = "dist" + ctx.Config.Dist = "dist" return nil } diff --git a/pipeline/fpm/fpm.go b/pipeline/fpm/fpm.go index c9c5eaae5..e6abae23d 100644 --- a/pipeline/fpm/fpm.go +++ b/pipeline/fpm/fpm.go @@ -54,7 +54,7 @@ func (Pipe) Run(ctx *context.Context) error { } func create(ctx *context.Context, format, archive, arch string) error { - var path = filepath.Join(ctx.Config.TargetFolder, archive) + var path = filepath.Join(ctx.Config.Dist, archive) var file = path + ".deb" var name = ctx.Config.Build.Binary log.Println("Creating", file) diff --git a/pipeline/release/release.go b/pipeline/release/release.go index 209eaf4dc..7f2020fee 100644 --- a/pipeline/release/release.go +++ b/pipeline/release/release.go @@ -89,7 +89,7 @@ func description(diff string) string { func upload(ctx *context.Context, client *github.Client, releaseID int, archive, format string) error { archive = archive + "." + format - var path = filepath.Join(ctx.Config.TargetFolder, archive) + var path = filepath.Join(ctx.Config.Dist, archive) // In case the file doesn't exist, we just ignore it. // We do this because we can get invalid combinations of archive+format here, // like darwinamd64 + deb or something like that.