Skip to content

Commit b025568

Browse files
authored
Merge pull request #11721 from vector-im/travis/fix-version
Fix version file for Docker images
2 parents 443d381 + 3389f7a commit b025568

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/docker-write-version.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
set -ex
44

5-
TAG=$(git describe --dirty --tags)
5+
TAG=$(git describe --tags)
66
BRANCH=$(git rev-parse --abbrev-ref HEAD)
77
DIST_VERSION=$TAG
88

99
# If the branch comes out as HEAD then we're probably checked out to a tag, so if the thing is *not*
1010
# coming out as HEAD then we're on a branch. When we're on a branch, we want to resolve ourselves to
1111
# a few SHAs rather than a version.
12-
if [ $BRANCH != 'HEAD' ]
12+
# Docker Hub doesn't always check out the tag and sometimes checks out the branch, so we should look
13+
# for an appropriately tagged branch as well (heads/v1.2.3).
14+
if [ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ]
1315
then
1416
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
1517
JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)

0 commit comments

Comments
 (0)