diff --git a/deploy/redeploy.py b/deploy/redeploy.py index 2839422bde..6e6e64aa15 100755 --- a/deploy/redeploy.py +++ b/deploy/redeploy.py @@ -110,20 +110,17 @@ def on_receive_jenkins_poke(): filename = download_file(tar_gz_url) print("Downloaded file: %s" % filename) name_str = filename.replace(".tar.gz", "") - untar_location = os.path.join(arg_extract_path, name_str) - untar_to(filename, untar_location) + untar_to(filename, arg_extract_path) + + extracted_dir = os.path.join(arg_extract_path, name_str) if arg_should_clean: os.remove(filename) - # stamp the version somewhere JS can get to it - with open(os.path.join(untar_location, "vector/version"), "w") as stamp_file: - stamp_file.write(name_str) - - create_symlink(source=os.path.join(untar_location, "vector"), linkname=arg_symlink) + create_symlink(source=extracted_dir, linkname=arg_symlink) if arg_config_location: - create_symlink(source=arg_config_location, linkname=os.path.join(untar_location, "vector", 'config.json')) + create_symlink(source=arg_config_location, linkname=os.path.join(extracted_dir, 'config.json')) return jsonify({}) diff --git a/jenkins.sh b/jenkins.sh index 2bccf0f88c..4cc141f0bc 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -25,11 +25,7 @@ cp -r olm/package node_modules/olm # run the mocha tests npm run test -# build our artifacts; dumps them in ./vector -npm run build:dev - -# gzip up ./vector -rm vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist +rm packages/vector-*.tar.gz || true # rm previous artifacts without failing if it doesn't exist # node_modules deps from 'npm install' don't have a .git dir so can't # rev-parse; but they do set the commit in package.json under 'gitHead' which @@ -39,4 +35,4 @@ JSSDK_SHA=$(grep 'gitHead' node_modules/matrix-js-sdk/package.json | cut -d \" - VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop -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) +DIST_VERSION=vector-$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA scripts/package.sh -d diff --git a/scripts/package.sh b/scripts/package.sh index 35f6f92a5a..9ae2901ab0 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -2,6 +2,11 @@ set -e +dev="" +if [ "$1" == '-d' ]; then + dev=":dev" +fi + if [ -n "$DIST_VERSION" ]; then version=$DIST_VERSION else @@ -9,7 +14,7 @@ else fi npm run clean -npm run build +npm run build$dev mkdir -p dist cp -r webapp vector-$version echo $version > vector-$version/version