1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-25 21:10:56 +02:00
Commit Graph

77 Commits

Author SHA1 Message Date
Carlos A Becker
b62d6c4a54
fix: better fix for empty dirs
refs #403
2021-11-14 11:12:53 -03:00
Carlos A Becker
3730d6ec1c
fix: memory error when using empty_dirs
refs #403
2021-11-14 10:58:28 -03:00
Carlos Alexandro Becker
2a86957187
feat: add deprecation notice interface (#399)
* feat: add deprecation notice interface

* fix: use a simple writer

* fix: use println
2021-11-12 23:07:18 -03:00
Erik G
4f5362102c
feat: directory content type with custom attributes (#390)
* Deprecate EmptyFolders and introduce dir contents.

* Handle explicit dirs with attributes correctly for Debs.

* Handle explicit dirs with attributes correctly for Apks.

* Sort contents by fields that are most relevant for the package.

* Make deprecation warning for empty_folders consistent.

* Name RPM directory tag more consistently.

* Fix deprecation notice in docs.

* Fix directory normalization for Debs and Apks.

* Revert Apk builder size in tests.

* Fix file sorting.

* Fix deprecated EmptyFolders handling in info.Validate.

* Fix Apk builder size in tests.

* Only stat content source when necessary.

* Allow src on dir content.

* Small addition to file_info docs.

* Fix typo in comments.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Remove content type fallthrough case.

* Fix typo in apk tests.

* Fix more typos.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-11-11 22:58:59 -03:00
Erik G
3f068f057c
fix: Improve performance of content destination collision detection (#388)
* Fix: Improve performance of content destination collision detection.

* Remove duplicate info.Validate call

* Fix tests.

* Remove another Validate call.
2021-11-06 14:10:46 -03:00
Erik G
e5c7e17300
feat: allow platform specific arch overrides. (#396)
* Feat: Allow platform specific arch overrides.

* Fix typos and make arch handling more consistent.
2021-11-06 14:04:50 -03:00
Carlos A Becker
fb0a007440
chore: fmt
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-10-12 14:42:00 -03:00
Erik G
2a331c5c7f
feat: compression option with xz support for deb (#363) 2021-09-04 10:24:52 -03:00
Carlos Alexandro Becker
5c895f6e80
feat: jsonschema (#350)
* feat: jsonschema

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: gitattr

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* docs: schema

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* docs: schema

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* docs: improvements

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-07-07 10:20:34 -07:00
Dmitri Muntean
5c1976b7cd
fix: remove semver parsing code before schema version detection (#333)
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-05-03 10:26:00 -03:00
Dj Gilcrease
fe1413c7af
feat: add version_schema config option to allow controlling how the version string is parsed. (#324)
closes #283
2021-04-23 00:36:16 +00:00
Cristian Ciutea
39f5bf392d
feat: add %pretrans %posttrans scriptlets (#322)
* create branch

* added rpm pretrans and posttrans scriptlets

* update rpmpack dependency

* updated acceptance testdata

* docs: updated documentation to include %pretrans and %posttrans rpm scripts

* cleanup

* docs: cleanup
2021-04-22 18:48:06 +00:00
Dj Gilcrease
501e743010
feat: add support for alpine pre and post upgrade scripts and add an upgrade test (#323) 2021-04-20 14:02:37 -07:00
Dj Gilcrease
41077943bd
test: clean up the acceptance tests (#292) 2021-04-15 17:25:39 -03:00
Joakim Karlsson
7701bb950c
feat: Support for deb's config maintenance script (#317)
* feat: Support for deb's config maintenance script

With debconf, the config script is responsible for asking any questions
necessary to configure a package [1]. Without this, we're forced to ask
questions in postinst, which is against best practices [2].

This commit adds the possibility to include a config script when using
debconf like so:

```yaml
deb:
  scripts:
    templates: ./my/templates
    config: ./my/config
```

[1] https://manpages.debian.org/jessie/debconf-doc/debconf-devel.7.en.html#THE_CONFIG_SCRIPT
[2] https://manpages.debian.org/jessie/debconf-doc/debconf-devel.7.en.html#THE_POSTINST_SCRIPT

* docs: Add info about deb config maintainer script
2021-04-14 14:43:42 +00:00
Dj Gilcrease
a61de3bb05
fix: switch to use gopenpgp (#315)
With Googles anouncement that x/crypto/openpgp is depreciated https://github.com/golang/go/issues/44226 we have decided to switch to github.com/ProtonMail/gopenpgp & github.com/ProtonMail/go-crypto/openpgp
2021-04-08 11:15:11 -07:00
Carlos Alexandro Becker
bf4f92763d
feat(ci): lint action, gocenter, tools (#304)
* feat(ci): lint action, gocenter, tools

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: go generate

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-02-27 17:15:05 +00:00
Dj Gilcrease
a8e33991fc
fix: allow using an env var in the signature.key_file field (#282) 2021-01-14 10:32:10 -08:00
Carlos Alexandro Becker
17af87eda2
fix: race condition and remove unused code (#273)
* refactor: small code improvements

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: small code improvements

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: race condition

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: race

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix invalid file

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* docs: fix synlinks/indent

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-12-30 19:15:16 +00:00
Carlos Alexandro Becker
2770e5be98
feat: more deprecated things to remove (#269)
* feat: more deprecated things to remove

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: more deprecated things to remove

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: format

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-25 13:15:15 +00:00
Carlos Alexandro Becker
62357a65e2
feat: version as v2 (#268)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-23 13:25:57 +00:00
Carlos Alexandro Becker
19817233b5
feat: remove deprecated options (#267)
* feat: remove deprecated options

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fixing

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: configs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tempdir

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: go 1.15

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: import

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: symlink

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-22 21:28:32 -03:00
Dj Gilcrease
c4ae30d749
feat: try to clean up and simplify the file adding interface (#255)
* feat: cleanup and simplify the file adding interface

* docs: update the configuration docs to focus on the new contents format for specifying files

* docs: correct spelling

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-12-15 13:47:00 -03:00
Erik G
7839385b21
feat: add an option to disable globbing (#248)
* feat: Add option to disable globbing.

* test: Fix failing tests.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-11-10 09:37:29 -03:00
wwade
8c19c6a283
feat: Support RPM ghost files (#245)
From the [Maximum RPM] guide:

    The %ghost Directive

    As we mentioned in the Section called The %files List, if a file
    is specified in the %files list, that file will automatically be
    included in the package. There are times when a file should be
    owned by the package but not installed - log files and state files
    are good examples of cases you might desire this to happen.

    The way to achieve this, is to use the %ghost directive. By adding
    this directive to the line containing a file, RPM will know about
    the ghosted file, but will not add it to the package.

Ghost files are specified using `Type: rpmpack.GhostFile` when
constructing the output package.

The test ensures that we have:
 - The target file present in the RPM.
 - The specified mode attributes (although not really important,
 either).
 - An empty file *[1]* in the RPM for the named ghost,
see [google/rpmpack #51].

*[1] Instead of an empty file, no file should be created, but this is
not possible until the upstream issue is resolved.*

[Maximum RPM]:
http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
[google/rpmpack #51]: https://github.com/google/rpmpack/issues/51

Co-authored-by: wwade <wwade@users.noreply.github.com>
2020-11-08 17:10:27 -03:00
wwade
13335ee883
feat: allow explicit summary from RPM packages (#246)
The previous behaviour was to use only the first line of the
description as the summary. In some cases, it is desirable to have a
separate summary. Since only RPM packages have a summary field, I've
put this inside the RPM configuration.

    description: This is my description
    rpm:
      summary: This is my summary

By default, just use the first line of the description.

Co-authored-by: wwade <wwade@users.noreply.github.com>
2020-11-08 14:49:40 -03:00
Ivan Vandot
7a70791bb0
feat: add support for deb templates (#240)
* add support for deb templates

* merge scripts and templates, make mode settable and move Templates to DebScripts

* add templates support to docs
2020-11-03 09:44:59 -03:00
Carlos Alexandro Becker
3d7580ade2
refactor: remove pkg/errors (#226)
* refactor: remove pkg/errors

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-09-19 17:06:07 -03:00
Erik G
285a6bcaea
feat: Package Signing (#224)
* feat: Add initial openpgp signing capability.

* refactor: Rename signatures to sigs and expose verify method.

* feat: Add debsigs support.

* test: Add debsigs acceptance test.

* feat: Add RSA signing capability.

* feat: Add RPM signature support.

* test: Add RPM signature acceptance test.

* test: Move acceptance test keys in dedicated folder.

* feat: Add APK signature support.

* test: Add APK signature acceptance test.

* feat: Expose deb signature type in config.

* fix: Fix typo and superfluous explicit error check

* fix: Fix password env extraction and add tests.

* fix: Redirect rpmpack to temporary goreleaser vendoring.

* fix: Catch missing maintainer email if no apk key name is set.

* refactor: Put signature info in a dedicated struct.

* doc: Add signing documentation.

* fix: Add trailing newlines to some files and remove unnecessary comment.

* fix: Change wrong references from SHA256 to SHA1 in the sign package.

* fix: Improve error wording when no passphrase was provided.

* fix: Remove another SHA256 reference.

* fix: Fix signature errors.

* test: Split up environment variable test.

* fix: Don't parse passphrase from YAML.

* deps: Update redirected rpmpack.

* fix: Export and use signature related error type.

* doc: Document ErrSigningFailure.

* test: Fix apk signature error test.

* test: Add rpm signature error test.
2020-09-17 09:18:44 -03:00
Erik G
fd176b36f6
feat: Support DEB Breaks field (#220)
* feat: Support DEB Breaks option.

* doc: Add docs for breaks relationship.

* fix: Increase test timeout.
2020-09-01 19:27:29 +00:00
Erik G
0c25629af7
feat: Introduce version_metadata for all packagers and deprecate deb.metadata. (#215) 2020-08-20 01:00:17 -03:00
Erik G
3c4244d700
fix: correctly handle version, release and prerelease for RPMs (#214) 2020-08-19 10:20:02 -03:00
Erik G
6d8f3f4a44
feat: Support RPM %config(noreplace) files. (#186) 2020-08-04 14:44:13 -03:00
Carlos Alexandro Becker
a80e10dea3
refactor: internal/files (#191)
* refactor: internal/files

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-04 10:11:03 -03:00
Erik G
005a6f885d
fix: Don't propagate semver metadata into deb metadata. (#187)
* fix: Don't propagate semver metadata into deb metadata.

* doc: Add documentation for new metadata behaviour.
2020-07-30 11:02:55 -03:00
Erik G
0000a2fe8d
feat: support symlinks for deb and rpm. (#185)
* feat: Support symlinks.

* fix: Fix symlink creation for deb.

* fix: Remove magic number in rpm symlink creation.

* test: Add symlink unit tests.

* test: Add symlink acceptance tests.

* doc: Add documentation for symlinks.

* fix: Fix acceptance test name.

* fix: Make symlink headers more consistent.
2020-07-29 23:20:50 -03:00
Erik G
0b4025a8f2
feat: Add support for DEB triggers. (#178)
* feat: Add support for DEB triggers.

* fix: Fix trigger test package description.

* fix: Use correct trigger keys in configuration documentation.
2020-07-27 13:22:06 -03:00
Erik G
d2e9097ac5
feat(#42): Support Changelogs (#158)
Co-authored-by: Dj Gilcrease <d.gilcrease@f5.com>

Co-authored-by: Dj Gilcrease <d.gilcrease@f5.com>
Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-13 15:10:03 +00:00
Carlos Alexandro Becker
397d266f18
feat: allow creating meta packages (#159)
* feat: allow creating meta packages

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: rpm pack meta

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: added acceptance tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-07-10 02:05:33 -03:00
Erik G
4804199f0a
feat: use conventional file names by default (#157)
Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-09 10:16:04 -03:00
Carlos Alexandro Becker
0743b6d7a4
fix: add back bindir
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-29 09:37:05 -03:00
Carlos Alexandro Becker
7b7ab3ffc7
docs: added docs website (#142)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-24 16:09:47 -03:00
Danny Zhu
a8eb8d7146
refactor: add a method on Info to list files to copy to the package (#136)
* refactor: add a method on Info to list files to copy to the package

Since iterating over the files to copy to the package is something that
all package formats need, adding a central place for that logic reduces
duplication.

Also sort the list of files as a step toward making builds more
reproducible.

* Update nfpm.go

* Rename `CopiedFile` to `FileToCopy`

* Add test for `FilesToCopy`

Co-authored-by: Danny Zhu <dzhu@dzhu.us>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-14 12:46:46 +00:00
Carlos Alexandro Becker
2768948b4e
feat: update golangci-lint (#137)
* fix: golangci-lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: update golangci-lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: docs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-13 16:24:06 -03:00
Carlos Alexandro Becker
1277d9bfcd
fix: lint
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-02-18 10:50:11 -03:00
astorath
4c6511a854
feat: version release/prerelease options (#111)
* feat: version release/prerelease options

* fix: review

* fix: lint

* fix: damn linters

* fix: acceptance tests

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-02-18 10:49:10 -03:00
Dj Gilcrease
2eb4016806
fix(#103): ensure the package is not included in itself (#104)
* fix(#103): ensure the package is not included in itself when using globs to match files

* chore: switch strings.Contains to strings.HasSuffix
2019-11-11 13:57:10 -08:00
Carlos Alexandro Becker
92cd25d767
fix(rpm): with defaults: fix version and pre-release (#101)
* fix(rpm): replace - with _ on version

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix(rpm): version

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-11-05 09:38:13 -03:00
Carlos Alexandro Becker
2f467f94fb
fix: remove rpm.Prefix and rpm.Release (#90)
* fix: remove rpm.Prefix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: remove rpm.Release

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: broken test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-10-22 18:29:42 -03:00
Dj Gilcrease
7889c9b2b6
fix: add stricter linting (#87)
* add stricter linting
* As part of this it changes the API slightly changing all uses of the `nfpm.Info` object to accept a pointer to reduce memory usage as pointed out by `hugeParam: info is heavy (568 bytes); consider passing it by pointer (gocritic)`
2019-10-11 13:11:28 -07:00