1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-28 11:41:58 +02:00
Commit Graph

383 Commits

Author SHA1 Message Date
Carlos Alexandro Becker
7feb0818ff
fix: invalid zip file (#253)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
v1.10.1
2020-11-10 18:25:58 -03:00
Carlos Alexandro Becker
105a426161
chore(deps): bump github.com/golangci/golangci-lint from 1.31.0 to 1.32.2 (#251)
* chore(deps): bump github.com/golangci/golangci-lint from 1.31.0 to 1.32.2

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

* fix: errors.is

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

* fix: typo

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

* fix: typo

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

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
v1.10.0
2020-11-10 10:35: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
Carlos Alexandro Becker
b93d8e6452 test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 09:34:52 -03:00
Carlos Alexandro Becker
f287ec7320 chore: go mod tidy
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 09:32:33 -03:00
dependabot-preview[bot]
91af31675a
chore(deps): bump github.com/goreleaser/fileglob from 0.2.1 to 0.3.0 (#250)
Bumps [github.com/goreleaser/fileglob](https://github.com/goreleaser/fileglob) from 0.2.1 to 0.3.0.
- [Release notes](https://github.com/goreleaser/fileglob/releases)
- [Commits](https://github.com/goreleaser/fileglob/compare/v0.2.1...v0.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-10 09:30:21 -03:00
dependabot-preview[bot]
d0b3637e61
chore(deps): bump github.com/goreleaser/chglog from 0.1.1 to 0.1.2 (#249)
Bumps [github.com/goreleaser/chglog](https://github.com/goreleaser/chglog) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/goreleaser/chglog/releases)
- [Changelog](https://github.com/goreleaser/chglog/blob/master/.goreleaser.yml)
- [Commits](https://github.com/goreleaser/chglog/compare/v0.1.1...v0.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-11-10 09:22:23 -03:00
Carlos Alexandro Becker
2e41d957e5
refactor: simplify rpm add file (#247)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-09 03:54:37 +00: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
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
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
Carlos Alexandro Becker
a2ffae7a5d
chore(ci): dont need to tidy anymore (#236)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
v1.9.0
2020-11-03 09:45:34 -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
Erik G
0e2c2844bb
fix: hash name typo. (#238) 2020-10-30 10:19:03 -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
Carlos Alexandro Becker
cfc8169548
docs: globs (#231)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-10-05 22:31:32 -03:00
Carlos Alexandro Becker
44adf8b27e
fix: auto-commit go mod tidy (#230)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-09-21 14:07:40 -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>
v1.8.0
2020-09-19 17:06:07 -03:00
github-actions[bot]
1666d2e168
chore(deps): go mod tidy (#228)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-19 10:13:25 -03:00
Erik G
c9bc9c6cd4
chore: Use upstream rpmpack. (#227) 2020-09-19 10:02:15 -03:00
github-actions[bot]
98376ea1dc
chore(deps): go mod tidy (#225)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-17 09:40:10 -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
github-actions[bot]
730f13d2e6
chore(deps): go mod tidy (#222)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-11 15:43:26 -03:00
dependabot-preview[bot]
7efe0c452b
chore(deps): bump github.com/golangci/golangci-lint (#221)
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.30.0 to 1.31.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.30.0...v1.31.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-08 10:15:32 -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) v1.7.0 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
5014c66146
docs: Give overrides examples for depends with version constraints. (#213) 2020-08-18 16:14:13 -03:00
Carlos Alexandro Becker
46bd304182 feat: allow cli to create apks
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-17 17:54:03 -03:00
Carlos Alexandro Becker
6aa03b0237 docs: fix overridables docs
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-17 17:53:49 -03:00
Carlos Alexandro Becker
4630d75b83 docs: apk
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-17 17:44:04 -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
Erik G
bb9a3c8c88
fix: Fix build badge and coverage format. (#211) 2020-08-17 15:42:19 -03:00
Erik G
62c61a56bd
fix: Remove leading slashes from files in .tag.gz files in deb. (#209)
* fix: Remove leading slashes from symlinks and changelog in deb.

* test: Test that deb .tar.gz files don't contain leading slashes.

* fix: Fix acceptance tests by removing slashes globally.
2020-08-17 14:12:23 -03:00
Erik G
b76edbd93c
test: Speed up tests by using smaller testdata. (#210) 2020-08-17 13:47:16 -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
github-actions[bot]
511a167ede
chore(deps): go mod tidy (#206)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-12 09:14:11 -03:00
dependabot-preview[bot]
be82ba473b
chore(deps): bump github.com/imdario/mergo from 0.3.10 to 0.3.11 (#204)
Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.10 to 0.3.11.
- [Release notes](https://github.com/imdario/mergo/releases)
- [Commits](https://github.com/imdario/mergo/compare/v0.3.10...v0.3.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-08-12 09:12:47 -03:00
Carlos Alexandro Becker
bcab51df2f refactor: move glob to internal
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
v1.6.0
2020-08-05 13:51:04 -03:00
Carlos Alexandro Becker
1c35d796c0 fix(ci): codecov
refs #198

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-05 09:49:13 -03:00
Erik G
6f3927324e
fix: Remove RPM group default. (#197) 2020-08-04 18:41:54 +00:00
Erik G
3cc1ea4186
test: Changed some asserts to requires for early out in tests. (#195)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-04 17:55:52 +00:00
github-actions[bot]
0b887c9f58
chore(deps): go mod tidy (#196)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-04 14:46:03 -03:00
Erik G
6d8f3f4a44
feat: Support RPM %config(noreplace) files. (#186) 2020-08-04 14:44:13 -03:00
github-actions[bot]
c5ca9a5d26
chore(deps): go mod tidy (#194)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-04 10:13:25 -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
github-actions[bot]
78049027c1
chore(deps): go mod tidy (#192)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-08-04 00:57:45 -03:00
dependabot-preview[bot]
c98d9bc176
chore(deps): bump github.com/golangci/golangci-lint from 1.29.0 to 1.30.0 (#190)
* chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.29.0...v1.30.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* fix: lint

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

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-04 03:18:44 +00:00