Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jenkins: always resolve tags to rev of the commit that got tagged
FC-41962 Closes #200 Previously, we always resolved tags to the commit rev. However if this failed, there was a fallback to the rev of the tag (the output of `git ls-remote` without the `^{}` modifier). This is a problem in a deployment where we rely on the rev being the commit rev since that's part of the S3 url where the frontend assets are stored. The reason for the fallback that lead to such a deployment error was a timing issue where the first `ls-remote` failed like this ssh: Could not resolve hostname gitlab.customer.com: Try again fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. and the second one (resolving to the tag's rev) succeeded. We now call `ls-remote` without the `^{}` modifier and check if the refspec got resolved to a tag (i.e. `refs/tags/...`). If that's the case, a second `ls-remote` is issued with the `^{}` modifier to get the rev of the commit that got tagged. If this second call fails, we fail hard to make sure we don't get incorrect results silently.
- Loading branch information