resonate
resonate copied to clipboard
Add version command
It would be nice to see the version of resonate I have installed locally.
resonate --version
The version is tied to the git tag and can be set via build flags in our release pipeline, we should assert that the git tag matches the version in our release pipeline.
- [ ] set tag in release pipeline
- [ ] assert git tag matches
resonate --version
Version can be derived from the Git Tag, but not necessarily required for the mvp.
kindly assign this to me
@rishirishhh - don't hesitate to reach out for any clarification or to chat about requirements and/or design!
@rishirishhh - are you still interested in working on this? If so, I highly recommend joining the Discord: https://resonatehq.io/discord and jump into the resonate-engineering channel to get any help you might need.
Hi, Can I work on this PR?
I already see this opened PR: https://github.com/resonatehq/resonate/pull/342
Is this still going? Can I take inspiration from this code or this solution is not valid?
Just closed that PR for being stale.
I think we can take inspiration from the ldflags, but simplify things a little bit. Here's what I'm thinking.
Add the following to the root command:
var (
cfgFile string
version string = "unknown"
)
var rootCmd = &cobra.Command{
Use: "resonate",
Short: "Resonate: distributed async await",
Version: version,
}
Then we can build resonate with an ldflag like this:
go build -ldflags "-X github.com/resonatehq/resonate/cmd.version=SET_VIA_LDFLAGS" -o resonate
./resonate --version
Most of the work will involve updating the build scripts to set the version accordingly. What do you think about the following strategy?
- Use git tag if available (eg: "v1.0.0")
- Otherwise use commit (eg: "cc66e5135531111757c3e28f0a6fc053bc7c8fa8")
- Otherwise, fall back to "unknown"
Hi, I think it makes sense.
I will look into this