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
Conversation
@jonathanlloyd is attempting to deploy a commit to the Goreleaser Team on Vercel. A member of the Team first needs to authorize it. |
c20545b
to
1449777
Compare
Codecov Report
@@ Coverage Diff @@
## master #1849 +/- ##
==========================================
+ Coverage 81.44% 81.68% +0.24%
==========================================
Files 73 73
Lines 3729 3779 +50
==========================================
+ Hits 3037 3087 +50
Misses 570 570
Partials 122 122
Continue to review full report at Codecov.
|
Overall it looks good, but we need to think how'll we handle the secrets... not sure if we can assume |
What about a
Thoughts? |
I would say to do something similar to what we have on the http pipe: https://goreleaser.com/customization/upload/ Just maybe use |
www/docs/customization/nfpm.md
Outdated
@@ -156,6 +156,39 @@ nfpms: | |||
"tmp/app_generated.conf": "/etc/app-rpm.conf" | |||
scripts: | |||
preinstall: "scripts/preinstall-rpm.sh" | |||
|
|||
# Custon configuration applied only to the Deb packager. |
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.
Custom
not Custon
@jonathanlloyd hey, do you plan on continue working on this? Otherwise I can take it from here :) |
Sorry, been super busy. I can take a look at it today 😄 |
322c5d5
to
ca44ac5
Compare
@caarlos0 I've updated the env var logic and added some tests |
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.
So far looks good to me, thanks 🙏🚀
After this is merged I will create PR to add deb |
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.
My PR to nfpm got merged, if you would like to include templates
file as well great and thanks :) If not I would create separate PR after this one is merged.
On top of all proposed changes you have to update deps go mod edit -require=github.com/goreleaser/nfpm@v1.9.0
internal/pipe/nfpm/nfpm.go
Outdated
@@ -173,6 +174,42 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries | |||
PreRemove: overridden.Scripts.PreRemove, | |||
PostRemove: overridden.Scripts.PostRemove, | |||
}, | |||
Deb: nfpm.Deb{ | |||
Scripts: nfpm.DebScripts{ | |||
Rules: overridden.Deb.Scripts.Rules, |
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
Templates: overridden.Deb.Scripts.Templates,
pkg/config/config.go
Outdated
|
||
// 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Add
Templates string `yaml:"templates,omitempty"`
deb: | ||
# Custom deb rules script. | ||
scripts: | ||
rules: foo.sh |
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.
Change this to this
# Custom deb special files.
scripts:
# Deb rules script.
rules: foo.sh
# Deb templates file, when using debconf.
templates: templates
Nice templates 👍 . Super stoked for this. |
updating nfpm already: #1883 |
Merged in the latest version of nfpm and added these changes :) |
Great work everyone, many thanks! 🚀 Would be awesome to add some example usages of these advanced options to docs as well (maybe in the how to session), if someone wants to tackle that, please feel free to do so 🙏 |
@caarlos0 I can for |
When I get to using the new features I can also create a PR for docs. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Add new nfpm config options to goreleaser
So that all the options offered by nfpm are available in goreleaser!
Closes: #1829