From 30df6b6679a1f852eeb3add3535613fbd9e0bb45 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker <caarlos0@gmail.com> Date: Sun, 8 Jul 2018 17:22:09 -0700 Subject: [PATCH 1/2] test: name template overrides on nfpm pipe ref #715 --- pipeline/nfpm/nfpm_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pipeline/nfpm/nfpm_test.go b/pipeline/nfpm/nfpm_test.go index bc58c12d4..7ad8d02f3 100644 --- a/pipeline/nfpm/nfpm_test.go +++ b/pipeline/nfpm/nfpm_test.go @@ -91,6 +91,9 @@ func TestRunPipe(t *testing.T) { ConfigFiles: map[string]string{ "./testdata/testfile.txt": "/etc/nope.conf", }, + Replacements: map[string]string{ + "linux": "Tux", + }, }, Overrides: map[string]config.NFPMOverridables{ "rpm": { @@ -101,6 +104,7 @@ func TestRunPipe(t *testing.T) { }, }, }) + ctx.Version = "1.0.0" ctx.Git = context.GitInfo{CurrentTag: "v1.0.0"} for _, goos := range []string{"linux", "darwin"} { for _, goarch := range []string{"amd64", "386"} { @@ -114,6 +118,11 @@ func TestRunPipe(t *testing.T) { } } assert.NoError(t, Pipe{}.Run(ctx)) + var packages = ctx.Artifacts.Filter(artifact.ByType(artifact.LinuxPackage)).List() + assert.Len(t, packages, 4) + for _, pkg := range packages { + assert.Contains(t, pkg.Name, "mybin_1.0.0_Tux_", "linux should have been replaced by Tux") + } assert.Len(t, ctx.Config.NFPM.Files, 1, "should not modify the config file list") } From 8f675d8d9134457e6713df1ec2b63e86a0849080 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker <caarlos0@gmail.com> Date: Sun, 8 Jul 2018 19:51:31 -0700 Subject: [PATCH 2/2] fix: nfpm: backslashes inside pkgs generated on windows closes #714 --- Gopkg.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index aa4f33691..1e79a16fc 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -140,8 +140,8 @@ "glob", "rpm" ] - revision = "25eddcb1759ae5b07e79bb55727075fe43492a17" - version = "v0.9.2" + revision = "923d6a7473bfdbe7a583b7f3df1f3f780b1b73ab" + version = "v0.9.3" [[projects]] name = "github.com/imdario/mergo"