File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Exclude a bunch of stuff which can make the build context a larger than it needs to be
2- .git /
32test /
43webapp /
54lib /
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ RUN yarn build
2121# Copy the config now so that we don't create another layer in the app image
2222RUN cp /src/config.sample.json /src/webapp/config.json
2323
24+ # Ensure we populate the version file
25+ RUN dos2unix /src/scripts/docker-write-version.sh && sh /src/scripts/docker-write-version.sh
26+
2427
2528# App
2629FROM nginx:alpine
Original file line number Diff line number Diff line change 22
33set -ex
44
5+ # Automatically link to develop if we're building develop, but only if the caller
6+ # hasn't asked us to build something else
7+ BRANCH=$( git rev-parse --abbrev-ref HEAD)
8+ if [ $USE_CUSTOM_SDKS == false ] && [ $BRANCH == ' develop' ]
9+ then
10+ echo " using develop dependencies for react-sdk and js-sdk"
11+ USE_CUSTOM_SDKS=true
12+ JS_SDK_BRANCH=' develop'
13+ REACT_SDK_BRANCH=' develop'
14+ fi
15+
516if [ $USE_CUSTOM_SDKS == false ]
617then
718 echo " skipping react-sdk and js-sdk installs: USE_CUSTOM_SDKS is false"
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -ex
4+
5+ TAG=$( git describe --dirty --tags)
6+ BRANCH=$( git rev-parse --abbrev-ref HEAD)
7+ DIST_VERSION=$TAG
8+
9+ # If the branch comes out as HEAD then we're probably checked out to a tag, so if the thing is *not*
10+ # coming out as HEAD then we're on a branch. When we're on a branch, we want to resolve ourselves to
11+ # a few SHAs rather than a version.
12+ if [ $BRANCH != ' HEAD' ]
13+ then
14+ REACT_SHA=$( cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD)
15+ JSSDK_SHA=$( cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD)
16+ VECTOR_SHA=$( git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
17+ DIST_VERSION=$VECTOR_SHA -react-$REACT_SHA -js-$JSSDK_SHA
18+ fi
19+
20+ echo $DIST_VERSION > /src/webapp/version
You can’t perform that action at this time.
0 commit comments