- 
                Notifications
    You must be signed in to change notification settings 
- Fork 34
Add version flag to generator #120
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
Add version flag to generator #120
Conversation
9ae54e0    to
    41c60bc      
    Compare
  
    0ae2ed9    to
    0a01472      
    Compare
  
    ref: open-cluster-management-io#118 ref: https://issues.redhat.com/browse/ACM-5803 Signed-off-by: Dale Haiducek <[email protected]>
0a01472    to
    aa03f1c      
    Compare
  
    | I've used @JustinKuli's idea in the latest code to default with fallbacks in the following order: 
 We could maybe add the org in there, but this ought to be enough information/fallbacks to find the version at play (or figure out that it wasn't built by us). | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold for @mprahl
This seems nicely automatic for now, with the possibility to override the setting for specific use cases in the future if we ever need to.
| ############################################################ | ||
| # build section | ||
| ############################################################ | ||
| GIT_VERSION := $(shell git describe --dirty 2>/dev/null) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to use --dirty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a safety/notification thing than anything. Without it, the -dirty suffix isn't added when there have been local changes:
When the working tree matches HEAD, the output is the same as "git describe HEAD". If the working tree has local modification "-dirty" is appended to it.
https://git-scm.com/docs/git-describe#Documentation/git-describe.txt---dirtyltmarkgt
| [APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, JustinKuli, mprahl, yiraeChristineKim The full list of commands accepted by this bot can be found here. The pull request process is described here 
Needs approval from an approver in each of these files:
 
 Approvers can indicate their approval by writing  | 
| /unhold | 
Adds a generator version flag with the Git SHA in the output:
Also adds verification that the
VERSION.txtfile was updated so that a release isn't created without the version being updated.This is my first time adding version information to anything, so if anyone has other ideas/pointers, do share!
ref: https://issues.redhat.com/browse/ACM-5803
Closes #118