Fetch the latest tag from the remote #885
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY:
Because if users don't regularly call the
git fetch --tags
on the repo, the tags are not updated in their git repos after the release and it may happen that old version will be deployed. However, if the user calledgit pull
and has the latests manifests, those are not guaranteed to work with some old release.It may sound quite artificial, but it happens and I also caught myself that
make deploy-full-local-setup
deploys some older version if I didn't pull the latest tags.HOW:
Using
:=
in the makefile so that the bash expression is evaluated only once, inside of theifndef VERSION
macro, so that we can have both: overridable value passed as env var to make and lazy evaluationgit fetch is not a fast operation, for me it takes ~1.3 sec. I did some measurements with this dummy target:
If the
?=
and no ifndef macro was used, the results are:note: this change doesn't break the reproducibility of old releases in a sense that even if I checkout some old commit and run the
deploy-full-local-setup
, the correct git tag will be used (the latest released up to that checked commit, not the very latest one)Signed-off-by: Jirka Kremser [email protected]