Fix jenkins script / redeployer

and make them re-use the package script rather than doing their
own thing
This commit is contained in:
David Baker 2016-11-08 17:08:01 +00:00
parent c8a6be1454
commit 3b06563960
3 changed files with 13 additions and 15 deletions

View file

@ -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({})

View file

@ -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

View file

@ -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