1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00

feat: nfpm maintainer scripts

Resolves #635
This commit is contained in:
tympanix 2018-04-18 23:56:15 +02:00 committed by Carlos Alexandro Becker
parent 42fe5761f7
commit d3fe7c3f33
2 changed files with 15 additions and 0 deletions

View File

@ -137,6 +137,15 @@ type NFPM struct {
Bindir string `yaml:",omitempty"`
Files map[string]string `yaml:",omitempty"`
ConfigFiles map[string]string `yaml:"config_files,omitempty"`
Scripts NFPMScripts `yaml:"scripts,omitempty"`
}
// NFPMScripts is used to specify maintainer scripts
type NFPMScripts struct {
PreInstall string `yaml:"preinstall,omitempty"`
PostInstall string `yaml:"postinstall,omitempty"`
PreRemove string `yaml:"preremove,omitempty"`
PostRemove string `yaml:"postremove,omitempty"`
}
// Sign config

View File

@ -119,6 +119,12 @@ func create(ctx *context.Context, format, arch string, binaries []artifact.Artif
Bindir: ctx.Config.NFPM.Bindir,
Files: files,
ConfigFiles: ctx.Config.NFPM.ConfigFiles,
Scripts: nfpm.Scripts{
PreInstall: ctx.Config.NFPM.Scripts.PreInstall,
PostInstall: ctx.Config.NFPM.Scripts.PostInstall,
PreRemove: ctx.Config.NFPM.Scripts.PreRemove,
PostRemove: ctx.Config.NFPM.Scripts.PostRemove,
},
}
if err = nfpm.Validate(info); err != nil {