Fix CI step failure to tag Docker image with latest release version #4304
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.
Resolves #4305
Impact: critical
Type: bugfix
Issue
CI process fails to push the
:latest
tag to docker sincev1.10.0
. Currentlyreactioncommerce/reaction:latest
points tov1.9.0
image.This is caused by the
sort
command called on the git tags. The current sort ranks 1.9.0 higher than 1.10.0. So we never get the correct highest tag.Solution
Adding the
--version-sort
flag to the sort command creates the correct tag version hierarchy.From the man page:
How To Test
Because the code section affected is in an
if
condition that checks that the merge happened on a master branch, testing this PR is not so direct.I tested that this worked by using another branch with that
if
statement removed. I also had to hard-code a commit SHA that is tied to the latest release in order to confirm that the command getting the CURRENT_RELEASE var works correctly. That way I could see this in the CI logs:Breaking changes
None
For the failing CI job (Dockerfile lint), see #4306