Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
builds:
- ldflags:
- -X github.com/elastic/elastic-package/internal/version.CommitHash={{.ShortCommit}}
- -X github.com/elastic/elastic-package/internal/version.BuildTime={{.Timestamp}}
Copy link
Member

Choose a reason for hiding this comment

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

Users are going to be probably more interested about the version itself 🙂 Add the tag to the output of elastic-package version too, so it displays something like this?

$ goreleaser build --skip-validate --single-target
$ ./dist/elastic-package_darwin_amd64/elastic-package version
elastic-package has been installed.
elastic-package v0.9.1 version-hash e59a09c (build time: 2021-07-16T13:11:19+02:00)
Suggested change
- -X github.com/elastic/elastic-package/internal/version.BuildTime={{.Timestamp}}
- -X github.com/elastic/elastic-package/internal/version.BuildTime={{.Timestamp}}
- -X github.com/elastic/elastic-package/internal/version.Tag={{.Tag}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to do this in the next follow-up (just after this one :) ) as it requires a bit of coding. With this PR I want to fix first what's still broken.

If you prefer I can try to modify version's logic in this PR (both options work for me).

Copy link
Member

Choose a reason for hiding this comment

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

SGTM to do it in a follow up.