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

Define common build tags to consume in .ko.yaml #493

Closed
embano1 opened this issue Nov 9, 2021 · 3 comments · Fixed by #1307
Closed

Define common build tags to consume in .ko.yaml #493

embano1 opened this issue Nov 9, 2021 · 3 comments · Fixed by #1307
Labels
help wanted Extra attention is needed lifecycle/frozen

Comments

@embano1
Copy link
Contributor

embano1 commented Nov 9, 2021

Since .ko.yaml is likely going to be used for more CI automation and releasing artifacts, it would be great to have access to common build variables, e.g. date/time (RFC3339), commit (short/long) and perhaps (git) tag instead of having to manually create them in the environment to reference them in .ko.yaml.

I know this might be out of scope for ko due to reasons (e.g. relying on git) but just wanted to throw this out so people can find this issue and an answer why this won't be implemented or if this is something you think is useful for the project.

Since .ko.yaml is inspired by goreleaser, we could reuse some of the standard build-related variables/templates (full list here).

Example .ko.yaml idea:

  ldflags:
  - -s -w
  - -extldflags "-static"
  - -X main.commit={{.Env.KO_COMMIT_LONG}}
  - -X main.shortCommit={{.Env.KO_COMMIT_SHORT}}
  - -X main.buildDate={{.Env.KO_DATETIME}}
@github-actions
Copy link

github-actions bot commented Feb 8, 2022

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@imjasonh
Copy link
Member

imjasonh commented Feb 8, 2022

This seems reasonable to me, I just don't know if any current maintainers have any time to prioritize it. Maybe if someone reading this feels like throwing together a PR to get an idea for how it might work, that could be helpful.

nmittler added a commit to nmittler/ko that referenced this issue May 11, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Also re-run `go mod vendor` in order to use `testify`.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
@nmittler
Copy link
Contributor

@imjasonh @embano1 I put together a potential fix: #1307. PTAL when you have a chance.

nmittler added a commit to nmittler/ko that referenced this issue May 12, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 12, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 12, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 14, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
imjasonh pushed a commit that referenced this issue May 15, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes #493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
nmittler added a commit to nmittler/ko that referenced this issue May 17, 2024
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes ko-build#493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed lifecycle/frozen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants