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: Add support for templating NFPM bindir #2466

Merged
merged 4 commits into from Sep 7, 2021

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Sep 7, 2021

In NFPM configuration, allow the Bindir to also be templated.

Why is this change being made ?

I'm creating a nagios plugin . Those are deployed in the /usr/lib/nagios/plugins directory on i386 arch. And in /usr/lib64/nagios/plugins on amd64 arch.
I wasn't able to achieve such behavior with RPM generation without this patch.

With this patch applied, one can use the following configuation:

nfpms:
  - file_name_template: '{{ .ProjectName }}_{{ .Arch }}'
[...]
    bindir: '/usr/lib{{ if ne .Arch "386" }}64{{ end }}/nagios/plugins'
[...]

closes #2460

riton and others added 3 commits September 5, 2021 20:43
Example: Allow software to be deployed in '/usr/lib64' directory on x86_64 arch
and in '/usr/lib' directory in i386
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 7, 2021
@vercel
Copy link

vercel bot commented Sep 7, 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/goreleaser/FBtWrfyh21mBnJaDY1zZjewY5mis
✅ Preview: https://goreleaser-git-feature-bindirtemplate-goreleaser.vercel.app

@caarlos0 caarlos0 self-assigned this Sep 7, 2021
@vercel vercel bot temporarily deployed to Preview September 7, 2021 18:30 Inactive
@caarlos0 caarlos0 added this to In progress in Board via automation Sep 7, 2021
@codecov
Copy link

codecov bot commented Sep 7, 2021

Codecov Report

Merging #2466 (c2802f5) into master (7d22a32) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2466      +/-   ##
==========================================
+ Coverage   83.01%   83.02%   +0.01%     
==========================================
  Files          87       87              
  Lines        6271     6275       +4     
==========================================
+ Hits         5206     5210       +4     
  Misses        915      915              
  Partials      150      150              
Impacted Files Coverage Δ
internal/pipe/nfpm/nfpm.go 94.64% <100.00%> (+0.07%) ⬆️

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 7d22a32...c2802f5. Read the comment docs.

@caarlos0 caarlos0 merged commit 8afb5ea into master Sep 7, 2021
Board automation moved this from In progress to Done Sep 7, 2021
@caarlos0 caarlos0 deleted the feature/bindir_template branch September 7, 2021 18:43
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
No open projects
Board
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants