Skip to content

Commit

Permalink
feat: nfpm symlinks
Browse files Browse the repository at this point in the history
closes #1861

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Nov 27, 2020
1 parent 513e6ad commit c011943
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/pipe/nfpm/nfpm.go
Expand Up @@ -169,6 +169,7 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries
EmptyFolders: overridden.EmptyFolders,
Files: files,
ConfigFiles: overridden.ConfigFiles,
Symlinks: overridden.Symlinks,
Scripts: nfpm.Scripts{
PreInstall: overridden.Scripts.PreInstall,
PostInstall: overridden.Scripts.PostInstall,
Expand Down
3 changes: 3 additions & 0 deletions internal/pipe/nfpm/nfpm_test.go
Expand Up @@ -112,6 +112,9 @@ func TestRunPipe(t *testing.T) {
ConfigFiles: map[string]string{
"./testdata/testfile.txt": "/etc/nope.conf",
},
Symlinks: map[string]string{
"/etc/nope2.conf": "/etc/nope.conf",
},
Replacements: map[string]string{
"linux": "Tux",
},
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Expand Up @@ -407,6 +407,7 @@ type NFPMOverridables struct {
EmptyFolders []string `yaml:"empty_folders,omitempty"`
Files map[string]string `yaml:",omitempty"`
ConfigFiles map[string]string `yaml:"config_files,omitempty"`
Symlinks map[string]string `yaml:"symlinks,omitempty"`
Scripts NFPMScripts `yaml:"scripts,omitempty"`
RPM NFPMRPM `yaml:"rpm,omitempty"`
Deb NFPMDeb `yaml:"deb,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions www/docs/customization/nfpm.md
Expand Up @@ -128,6 +128,10 @@ nfpms:
"tmp/app_generated.conf": "/etc/app.conf"
"conf/*.conf": "/etc/foo/"

# Symlinks mapping from symlink name inside package to target inside package (overridable)
symlinks:
/sbin/foo: /usr/local/bin/foo

# Scripts to execute during the installation of the package.
# Keys are the possible targets during the installation process
# Values are the paths to the scripts which will be executed
Expand Down

1 comment on commit c011943

@vercel
Copy link

@vercel vercel bot commented on c011943 Nov 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.