Skip to content

Commit 9289158

Browse files
committed
Use npm to fetch react-sdk and js-sdk
After some discussion, we've agreed it's less evil to have package.json point to git develop, even if you then have to do a manual build step. That avoids any future problems where (for example) js-sdk develop gains experimental changes which would break for users using a build process which involves a manual git checkout.
1 parent 8fa059f commit 9289158

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

‎jenkins.sh‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ nvm use 4
88

99
set -x
1010

11-
# install the versions of js-sdk and react-sdk provided to us by jenkins
12-
npm install ./node_modules/matrix-js-sdk-*.tgz
13-
npm install ./node_modules/matrix-react-sdk-*.tgz
14-
15-
# install the other dependencies
1611
npm install
1712

13+
# we may be using a dev branch of react-sdk, in which case we need to build it
14+
(cd node_modules/matrix-react-sdk && npm run build)
15+
1816
# build our artifacts; dumps them in ./vector
1917
npm run build
2018

2119
# gzip up ./vector
2220
rm vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist
2321

24-
REACT_SHA=$(head -c 12 node_modules/matrix-react-sdk/git-revision.txt)
25-
JSSDK_SHA=$(head -c 12 node_modules/matrix-js-sdk/git-revision.txt)
22+
# node_modules deps from 'npm install' don't have a .git dir so can't
23+
# rev-parse; but they do set the commit in package.json under 'gitHead' which
24+
# we're grabbing here.
25+
REACT_SHA=$(grep 'gitHead' node_modules/matrix-react-sdk/package.json | cut -d \" -f 4 | head -c 12)
26+
JSSDK_SHA=$(grep 'gitHead' node_modules/matrix-js-sdk/package.json | cut -d \" -f 4 | head -c 12)
27+
2628
VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop
29+
2730
tar -zcvhf vector-$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA.tar.gz vector #g[z]ip, [c]reate archive, [v]erbose, [f]ilename, [h]ard-dereference (do not archive symlinks)

0 commit comments

Comments
 (0)