1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-30 18:01:23 +02:00
Commit Graph

55 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
a83e6466a0
feat: replace glob library (#244)
* feat: replace glob library

BREAKING CHANGE: may have unintended side-effects.

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

* fix: delimiter and patterns starting with ./

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

* fix: use fileglob

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

* test: fixed some wrong tests

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

* fix: tests

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

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-08 17:09:12 -03:00
Erik Geiser
6b9ef195fb
fix: upgrade zglob (#234)
* chore: Update zglob.

* test: Use dnf instead of yum.

* test: Test escaped braces in globs.
2020-10-23 07:39:36 -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
e3d6f8344d
fix: Change upgrade to update in changelog dockerfile (#223) 2020-09-13 11:51:00 -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
59de11a9e4
fix: deb file path prefixes and md5sums file (#218)
* fix: Ensure relative path prefix for deb packages

This patch ensures that all items contained in tar.gz files in Debian
packages have a relative path prefix, so the names all start with "./".
While this is not strictly required for a Debian package to function,
detecting a changed config file fails with an error messages similar to
the following:

    tar: ./etc/default/conffilename: Not found in archive

It seems to fail extracting config files for checking if they have been
modified by the system administrator.

All reference documentation that I was able to find (e.g. in the Debian
Handbook[1]) shows that all paths contained in either data.tar.gz and
control.tar.gz have the prefix "./".

I've verified that with this change, config files works as expected.

[1] https://debian-handbook.info/browse/stable/packaging-system.html#sect.binary-package-structure

* fix: Remove dpkg filters for changelog acceptance test.

* fix: Fix broken md5sums file when a changelog is added.

Co-authored-by: Alexander Neumann <alexander.neumann@redteam-pentesting.de>
2020-08-24 16:34:28 -03: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
Carlos Alexandro Becker
2e97c8de26
feat: apk support (#207)
* first attempt at apk, built from Issue #39

* inspector cleanups

* read the contrib note, ran linter, fixes made. Noice!

* linter went wonky

* linter went wonky

* fix some lint issues

* fix some lint issues

* lightweight file validation, while I try to refactor method into smaller chunks

* refactorings to get `make ci` to pass. ain't pretty, but hopefully doesn't make things worse.

* add ignore file to get workdir created in CI

* try to get a successful test run on CI (file sizes differ on CI).

* must remember to run liner (make ci) before pushing

* Doh! Detect CI via correct env var name

* tweak CI expected file sizes

* blech. try to get a range of values for CI

* better message if value fails conditions

* better message if value fails conditions

* initial impl of Package interface - just hoping I don't already have the arch mapping backwards.

* missed non-altered arch case

* ci failures

* refactor io.File to Writer

* add note about command to test apk install in docker

* remove absolute paths from test (prep for replacement with info.Files).

* rename test files folder

* get ci file size ranges happy after path changes

* get ci file size ranges happy after path changes

* move COPY towards end, allowing more caching of layers - feedback from @tcurdt

* remove Gz from function name

* rename combine function

* add skipVerify flag to preserve generated .apk file for use in dockerfile manual test. Thanks @tcurdt

* make ci is my friend

* remove useless comment

* start conversion to nfpm.Info

* use base64 encoded string for private signing key

* remove old runit() method, as we can now test using Default.Package.
add some tests lifted from deb_test.go.

* duck and cover: register the apk packager

* use the metadata from nfpm (does not handle scripts/pre/post, etc)

* getting closer to removing size assertions, but not just yet

* getting closer to removing size assertions, but not just yet

* add niffty import for init - Blank identifier comes to the rescue. Thanks @tcurdt.
add apk to overrides parse test.

* I will very much enjoy deleting this assertion...soon, soon.

* add PrivateKeyFile option, which is subordinate to PrivateKey

* move PrivateKey configs to root config struct. expand PrivateKey configs from env vars if set.

* provide the user a hint if privatekey config is missing for .apk packager

* lovin' the linter now. learning language from linter loudness. didn't know switch could work like that.

* add support for 'scripts' in control file

* fix control metadata

* make signing keyname configurable

* goofy size fix

* remove temporary test and related files

* fix template copy/pasta error

* remove old print statements

* first take at integration tests. should remove need for --allow-untrusted in `apk add` command.

* fix: merge issues, remove signature support

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

* fix: tests

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

* fix: lint issues

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

* fix: tests

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

* test: meta

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

* fix: datahash seems unused

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

* fix: improve test code

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

* fix: unused params

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

* fix: tests

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

* test: changelog test

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

* test: fix

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

* fix: img

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

* test: symlink

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

* fix: uneeded deletes

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

* feat: symlinks

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

Co-authored-by: Dan Rollo <danrollo@gmail.com>
2020-08-17 17:28:38 -03:00
Carlos Alexandro Becker
abb576b359
ci: make acceptance test logs more readable (#208)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-16 13:13:00 -03:00
Erik G
6d8f3f4a44
feat: Support RPM %config(noreplace) files. (#186) 2020-08-04 14:44:13 -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
Carlos Alexandro Becker
42f29b9d7a
chore(ci): run fast tests first (#182)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-07-29 23:12:40 -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
815450cd78
fix: Improve changelog formatting. (#169)
Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-15 09:21:52 -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
Carlos Alexandro Becker
07a8534053
test: pkg dependencies (#153)
* test: pkg dependencies

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

* fix: typo

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

* fix: flag

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-07-01 17:48:06 -03:00
Evan Baker
8926c7d5d9
fix: rpm recommends (#152)
* fix: Include recommends in RPM.

* test recommends
2020-07-01 17:18:18 -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
Carlos Alexandro Becker
60adb12ef3
fix: ensure rpm files have owner (#117)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-01-15 16:23:05 -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
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
Dj Gilcrease
b47eac0b54
Merge pull request #85 from djgilcrease/bugfix/issue-50
fix: parse the version as a semver
2019-10-09 18:11:58 -07:00
Dj Gilcrease
03193b2ab0 feat: provide more field support for rpms (#79)
* fix: properly add the PostRemove script, not the PostInstall script

* feat: provide more field support for rpms

New RPM fields
---
* Description
* OS <= info.Platform
* Licence
* URL <= info.Homepage
* Vendor
* Packager <= info.Maintainer
* Provides
* Require <= info.Depends
* Obsolete <= info.Replaces
* Suggests
* Conflicts

Fixes
---
* RPM Compression types are supported again
* RPM Config files are supported again
  * `rpmpack` will support all the rpm file types, so we could extend this more latter

* chore: disable wsl (a new linter in 1.20.x got golangci-lint) until we decide to enable it

* chore: address PR comments
2019-10-09 16:10:05 -03:00
Carlos Alexandro Becker
33156b2b19
fix: rules tests, overridables (#66)
* fix: rules tests, overridables

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

* doc: gogoc

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

* fix: rpm template

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

* fix: rpm template

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-08-31 10:21:28 -03:00
Carlos Alexandro Becker
214d773fe2
fix: improve rpm release config (#64)
* fix: improve rpm release config

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

* fix: template

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-08-25 12:12:38 -03:00
Adrian Wennberg
c17636c028 feat: Add option for RPM compression type (#63)
* feat: Add option for RPM compression type

See #62

* test: acceptance test for rpm compression types
2019-08-23 10:49:04 -03:00
Christoph Hartmann
793979844f add support for build rpm packages for aarch64 (#56)
* add support for build rpm packages for aarch64

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* add unit test to verify the manipulation of the arch field

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* add acceptance test for arm64 builds

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* use newer travis ubuntu distro

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* enable binfmt in docker

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2019-06-28 14:14:45 -03:00
Carlos Alexandro Becker
3e79ba0a5b
fix: skip ppc64le tests 2019-03-19 21:54:42 -03:00
Carlos Alexandro Becker
26a86166dc
feat: test os ppc64le too 2019-03-19 21:34:06 -03:00
Carlos Alexandro Becker
32909dea74
fix: lint issues 2019-03-04 10:14:05 -03:00
Carlos Alexandro Becker
e9205e74c0
fix: lint issues 2018-09-12 13:17:59 -03:00
Carlos Alexandro Becker
2615d25f99 refactor: accept params struct on ITs 2018-07-08 19:49:15 -07:00
Carlos Alexandro Becker
a0f04ab682
test: fix duplicated code and other issues 2018-06-04 09:08:27 -03:00
Carlos Alexandro Becker
8063cc1207 test: parallel acceptance tests 2018-05-16 21:42:34 -03:00
Carlos Alexandro Becker
09991ab785 test: empty managed dirs acceptance tests 2018-05-16 21:42:34 -03:00
Carlos Alexandro Becker
03334d1cf3
chore: faster it test by not sending too much context to docker daemon 2018-05-16 20:36:03 -03:00
Carlos Alexandro Becker
e8abe2ac61
test: added acceptance tests for overrides 2018-04-18 22:15:58 -03:00
Tympanix
b3e51e12b4 test: e2e test for rpm maintainer scripts 2018-04-09 13:19:45 -03:00
Tympanix
d598c7fcbb test: e2e tests for deb maintainer scripts 2018-04-09 13:19:45 -03:00
Carlos Alexandro Becker
672aa2bd65 fix: better validations 2018-04-05 09:51:01 -03:00
Carlos Alexandro Becker
0c117a72f5 test: added acceptance tests for versions with dash 2018-03-28 15:12:11 -03:00
Carlos Alexandro Becker
1238660a59
test: acceptance tests for globs
refs #17
2018-03-25 15:58:44 -03:00
Carlos Alexandro Becker
7c68620dff
test: fixed debian test 2018-03-23 14:14:04 -03:00
Carlos Alexandro Becker
0ed55a12bc
test: acceptance tests for rpm i386 2018-03-23 14:04:38 -03:00
Carlos Alexandro Becker
b4d00589a1
test: acceptance tests for debian i386 2018-03-23 13:56:57 -03:00
Carlos Alexandro Becker
2c9404b5b7
test: added empty file to make go test happy 2018-03-11 15:38:24 -03:00