Skip to content
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

feat: Support for deb's config maintenance script #317

Merged

Conversation

joakimkarlsson
Copy link
Contributor

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:

Avoid asking questions in the postinst. Instead, the config script should ask questions using debconf, so that pre-configuration will work.

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

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

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

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
@vercel
Copy link

vercel bot commented Apr 11, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/goreleaser/nfpm/DXqrArnpVitezepoxXqoWD2HByJi
✅ Preview: https://nfpm-git-fork-joakimkarlsson-deb-config-mainte-b73211.vercel.app

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 11, 2021
@vercel vercel bot temporarily deployed to Preview April 11, 2021 08:58 Inactive
@codecov
Copy link

codecov bot commented Apr 11, 2021

Codecov Report

Merging #317 (283e924) into master (876fed4) will increase coverage by 0.07%.
The diff coverage is 100.00%.

❗ Current head 283e924 differs from pull request most recent head a117877. Consider uploading reports for the commit a117877 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
+ Coverage   70.13%   70.21%   +0.07%     
==========================================
  Files           9        9              
  Lines        1135     1138       +3     
==========================================
+ Hits          796      799       +3     
  Misses        209      209              
  Partials      130      130              
Impacted Files Coverage Δ
nfpm.go 86.40% <ø> (ø)
deb/deb.go 66.44% <100.00%> (+0.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 876fed4...a117877. Read the comment docs.

Copy link
Contributor

@djgilcrease djgilcrease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vercel vercel bot temporarily deployed to Preview April 14, 2021 05:51 Inactive
Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, can you also add it to the docs?

@vercel vercel bot temporarily deployed to Preview April 14, 2021 14:31 Inactive
Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@kodiakhq kodiakhq bot merged commit 7701bb9 into goreleaser:master Apr 14, 2021
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants