New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add packager-specific nfpm config (#1829) #1849
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1449777
feat: Add deb packager-specific nfpm config (#1829)
jonathanlloyd b422197
Merge remote-tracking branch 'upstream/master' into latest-nfpm-config
jonathanlloyd 5d815ff
Use env vars containing nfpm ids for deb pgp passphrase
jonathanlloyd ca44ac5
Add docs for nfpm id in env var
jonathanlloyd 8b68b09
Custon -> Custom
jonathanlloyd 9ecc6ef
Switch test cases
jonathanlloyd eb7a59e
Forward RPM specific config to nfpm
jonathanlloyd 213c807
Document rpm-specific nfpm config
jonathanlloyd 50b3919
Add APK-specific nfpm config
jonathanlloyd a2ceae5
Document apk-specific nfpm config
jonathanlloyd 03eeeab
avaiable -> available
jonathanlloyd 4026a2d
Merge remote-tracking branch 'upstream/master' into latest-nfpm-config
jonathanlloyd d4712e5
Add deb scripts templates to nfpm config
jonathanlloyd File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -323,6 +323,41 @@ type NFPMScripts struct { | |
PostRemove string `yaml:"postremove,omitempty"` | ||
} | ||
|
||
// NFPMDebScripts is scripts only available on deb packages. | ||
type NFPMDebScripts struct { | ||
Rules string `yaml:"rules,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add
|
||
} | ||
|
||
// NFPMDebTriggers contains triggers only available for deb packages. | ||
// https://wiki.debian.org/DpkgTriggers | ||
// https://man7.org/linux/man-pages/man5/deb-triggers.5.html | ||
type NFPMDebTriggers struct { | ||
Interest []string `yaml:"interest,omitempty"` | ||
InterestAwait []string `yaml:"interest_await,omitempty"` | ||
InterestNoAwait []string `yaml:"interest_noawait,omitempty"` | ||
Activate []string `yaml:"activate,omitempty"` | ||
ActivateAwait []string `yaml:"activate_await,omitempty"` | ||
ActivateNoAwait []string `yaml:"activate_noawait,omitempty"` | ||
} | ||
|
||
// NFPMDebSignature contains config for signing deb packages created by nfpm. | ||
type NFPMDebSignature struct { | ||
// PGP secret key, can be ASCII-armored | ||
KeyFile string `yaml:"key_file,omitempty"` | ||
KeyPassphrase string `yaml:"-"` // populated from environment variable | ||
// origin, maint or archive (defaults to origin) | ||
Type string `yaml:"type,omitempty"` | ||
} | ||
|
||
// NFPMDeb is custom configs that are only available on deb packages. | ||
type NFPMDeb struct { | ||
Scripts NFPMDebScripts `yaml:"scripts,omitempty"` | ||
Triggers NFPMDebTriggers `yaml:"triggers,omitempty"` | ||
Breaks []string `yaml:"breaks,omitempty"` | ||
VersionMetadata string `yaml:"metadata,omitempty"` // Deprecated: Moved to Info | ||
Signature NFPMDebSignature `yaml:"signature,omitempty"` | ||
} | ||
|
||
// NFPMOverridables is used to specify per package format settings. | ||
type NFPMOverridables struct { | ||
FileNameTemplate string `yaml:"file_name_template,omitempty"` | ||
|
@@ -338,6 +373,7 @@ type NFPMOverridables struct { | |
Files map[string]string `yaml:",omitempty"` | ||
ConfigFiles map[string]string `yaml:"config_files,omitempty"` | ||
Scripts NFPMScripts `yaml:"scripts,omitempty"` | ||
Deb NFPMDeb `yaml:"deb,omitempty"` | ||
} | ||
|
||
// Sign config. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,42 @@ nfpms: | |
"tmp/app_generated.conf": "/etc/app-rpm.conf" | ||
scripts: | ||
preinstall: "scripts/preinstall-rpm.sh" | ||
|
||
# Custom configuration applied only to the Deb packager. | ||
deb: | ||
# Custom deb rules script. | ||
scripts: | ||
rules: foo.sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change this to this
|
||
|
||
# Custom deb triggers | ||
triggers: | ||
# register interrest on a trigger activated by another package | ||
# (also available: interest_await, interest_noawait) | ||
interest: | ||
- some-trigger-name | ||
# activate a trigger for another package | ||
# (also available: activate_await, activate_noawait) | ||
activate: | ||
- another-trigger-name | ||
|
||
# Packages which would break if this package would be installed. | ||
# The installation of this package is blocked if `some-package` | ||
# is already installed. | ||
breaks: | ||
- some-package | ||
|
||
# The package is signed if a key_file is set | ||
signature: | ||
# PGP secret key (can also be ASCII-armored). The passphrase is taken | ||
# from the environment variable $NFPM_ID_DEB_PASSPHRASE with a fallback | ||
# to $NFPM_ID_PASSPHRASE, where ID is the id of the current nfpm config. | ||
# The id will be transformed to uppercase. | ||
# E.g. If your nfpm id is 'default' then the deb-specific passphrase | ||
# should be set as $NFPM_DEFAULT_DEB_PASSPHRASE | ||
key_file: key.gpg | ||
# The type describes the signers role, possible values are "origin", | ||
# "maint" and "archive". If unset, the type defaults to "origin". | ||
type: origin | ||
``` | ||
|
||
!!! tip | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add