Merge pull request #11721 from vector-im/travis/fix-version

Fix version file for Docker images
This commit is contained in:
Travis Ralston 2020-01-02 08:51:05 -07:00 committed by GitHub
commit b0255683e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,14 +2,16 @@
set -ex set -ex
TAG=$(git describe --dirty --tags) TAG=$(git describe --tags)
BRANCH=$(git rev-parse --abbrev-ref HEAD) BRANCH=$(git rev-parse --abbrev-ref HEAD)
DIST_VERSION=$TAG 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* # 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 # 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. # 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 then
REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD) 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) JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)