mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
feat: nfpm: support config files (#566)
* feat: nfpm: support config files * bump: nfpm
This commit is contained in:
parent
f0722a1f4a
commit
4139509f43
6
Gopkg.lock
generated
6
Gopkg.lock
generated
@ -75,8 +75,8 @@
|
|||||||
"deb",
|
"deb",
|
||||||
"rpm"
|
"rpm"
|
||||||
]
|
]
|
||||||
revision = "cb781e182dd5a49482ff65f5ca2d6e1a532ce72c"
|
revision = "4f995bd813a38e5271ee1c5287309637fb98bc74"
|
||||||
version = "v0.3.1"
|
version = "v0.4.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/masterminds/semver"
|
name = "github.com/masterminds/semver"
|
||||||
@ -188,6 +188,6 @@
|
|||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "e285c44ad7f186982ec9664758175370a3d8f710ef20e665dcdb993dbea7f4cf"
|
inputs-digest = "12fbbded2568c173b0a125ed5fd89c7ce2782586910277eb29d64efc8f7749f7"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
@ -54,4 +54,4 @@
|
|||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/goreleaser/nfpm"
|
name = "github.com/goreleaser/nfpm"
|
||||||
version = "~0.3.0"
|
version = "~0.4.0"
|
||||||
|
@ -131,6 +131,7 @@ type FPM struct {
|
|||||||
License string `yaml:",omitempty"`
|
License string `yaml:",omitempty"`
|
||||||
Bindir string `yaml:",omitempty"`
|
Bindir string `yaml:",omitempty"`
|
||||||
Files map[string]string `yaml:",omitempty"`
|
Files map[string]string `yaml:",omitempty"`
|
||||||
|
ConfigFiles map[string]string `yaml:"config_files,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sign config
|
// Sign config
|
||||||
|
@ -116,7 +116,7 @@ func create(ctx *context.Context, format, arch string, binaries []artifact.Artif
|
|||||||
License: ctx.Config.NFPM.License,
|
License: ctx.Config.NFPM.License,
|
||||||
Bindir: ctx.Config.NFPM.Bindir,
|
Bindir: ctx.Config.NFPM.Bindir,
|
||||||
Files: files,
|
Files: files,
|
||||||
// ConfigFiles: "" TODO: add this config_files to nfpm settings,
|
ConfigFiles: ctx.Config.NFPM.ConfigFiles,
|
||||||
}
|
}
|
||||||
|
|
||||||
packager, err := nfpm.Get(format)
|
packager, err := nfpm.Get(format)
|
||||||
|
@ -73,7 +73,12 @@ func TestRunPipe(t *testing.T) {
|
|||||||
Maintainer: "me@me",
|
Maintainer: "me@me",
|
||||||
Vendor: "asdf",
|
Vendor: "asdf",
|
||||||
Homepage: "https://goreleaser.github.io",
|
Homepage: "https://goreleaser.github.io",
|
||||||
Files: map[string]string{},
|
Files: map[string]string{
|
||||||
|
"./testdata/testfile.txt": "/usr/share/testfile.txt",
|
||||||
|
},
|
||||||
|
ConfigFiles: map[string]string{
|
||||||
|
"./testdata/testfile.txt": "/etc/nope.conf",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
ctx.Version = "1.0.0"
|
ctx.Version = "1.0.0"
|
||||||
@ -89,7 +94,7 @@ func TestRunPipe(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert.NoError(t, Pipe{}.Run(ctx))
|
assert.NoError(t, Pipe{}.Run(ctx))
|
||||||
assert.Empty(t, ctx.Config.NFPM.Files, "should not modify the config file list")
|
assert.Len(t, ctx.Config.NFPM.Files, 1, "should not modify the config file list")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInvalidNameTemplate(t *testing.T) {
|
func TestInvalidNameTemplate(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user