From 3389f7afc991a5c15a79db73b2c294b927122d9a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 24 Dec 2019 18:34:40 -0700 Subject: [PATCH] Fix version file for Docker images Fixes https://github.com/vector-im/riot-web/issues/11642 --- scripts/docker-write-version.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/docker-write-version.sh b/scripts/docker-write-version.sh index 0ca2a477ee..730f47af7b 100644 --- a/scripts/docker-write-version.sh +++ b/scripts/docker-write-version.sh @@ -2,14 +2,16 @@ set -ex -TAG=$(git describe --dirty --tags) +TAG=$(git describe --tags) BRANCH=$(git rev-parse --abbrev-ref HEAD) DIST_VERSION=$TAG # If the branch comes out as HEAD then we're probably checked out to a tag, so if the thing is *not* # coming out as HEAD then we're on a branch. When we're on a branch, we want to resolve ourselves to # a few SHAs rather than a version. -if [ $BRANCH != 'HEAD' ] +# Docker Hub doesn't always check out the tag and sometimes checks out the branch, so we should look +# for an appropriately tagged branch as well (heads/v1.2.3). +if [ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ] then REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD) JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)