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

Allow output template changes for single-target mode #2685

Closed
SuperQ opened this issue Nov 23, 2021 · 3 comments · Fixed by #2701
Closed

Allow output template changes for single-target mode #2685

SuperQ opened this issue Nov 23, 2021 · 3 comments · Fixed by #2701
Labels
enhancement New feature or request
Projects

Comments

@SuperQ
Copy link
Contributor

SuperQ commented Nov 23, 2021

Is your feature request related to a problem? Please describe.

For --single-target builds where the user wants to just get a binary output, it would be nice to be able to override the dist and name_template. This way our project can have a simple make build that outputs a ./project_name binary.

Describe the solution you'd like

A configuration option like this:

single_target:
  destination: './'
  name_template: "{{ .Binary }}"

Describe alternatives you've considered

We could have a post-build script that moves the dist/binary_name into the local dir, but I think it would be cleaner if the single-target mode moved the built binary into place.

Additional context

This would help with the transition away from the Prometheus promu builder.

@SuperQ SuperQ added the enhancement New feature or request label Nov 23, 2021
@caarlos0 caarlos0 added this to New issues in Board via automation Nov 23, 2021
@SuperQ
Copy link
Contributor Author

SuperQ commented Nov 23, 2021

@caarlos0 Not sure how involved this would be. Or if it would be better to build the binary directly to the target location, or build and mv.

@caarlos0
Copy link
Member

I need to take a look, but I was thinking that maybe when using --single-target we could build to . by default (or move after built automatically) and also name the binary as go build would... 🤔

OR, accept a -o flag like go build does...

@caarlos0
Copy link
Member

what do you think about #2701 @SuperQ ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Board
New issues
Development

Successfully merging a pull request may close this issue.

2 participants