From 6b2ef589ed8ef5d253f6213e1bb275cbe135f2b4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 Jan 2018 11:10:46 +0100 Subject: Prepare production workflow --- scripts/release.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/release.sh b/scripts/release.sh index 572e6bdca..07fec00b8 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,7 +1,33 @@ #!/bin/bash -npm run build -npm test +shutdown() { + # Get our process group id + PGID=$(ps -o pgid= $$ | grep -o [0-9]*) + + # Kill it in a new new process group + setsid kill -- -$PGID + exit 0 +} + +trap "shutdown" SIGINT SIGTERM + +if [ -z "$1" ]; then + echo "Need version as argument" + exit -1 +fi + +cd ./client || exit -1 +npm version --no-git-tag-version --no-commit-hooks $1 || exit -1 + +cd ../ || exit -1 +npm version -f --no-git-tag-version --no-commit-hooks $1 || exit -1 + +git commit package.json client/package.json -m "Bumped to version $1" || exit -1 +git tag -s -a "v$1" -m "v$1" + +npm run build || exit -1 +#npm test || exit -1 cd ../ || exit -1 +rm -f PeerTube/peertube.zip || exit -1 zip -r PeerTube/peertube.zip PeerTube/{CREDITS.md,node_modules,FAQ.md,LICENSE,README.md,client/dist/,client/yarn.lock,client/package.json,config,dist,package.json,scripts,support,tsconfig.json,yarn.lock} -- cgit v1.2.3