From 9f540774b1fa2d9035a8b19dd1901247b112ead5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Oct 2016 14:23:20 +0200 Subject: Add upgrade script --- scripts/help.sh | 1 + scripts/upgrade.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 scripts/upgrade.sh (limited to 'scripts') diff --git a/scripts/help.sh b/scripts/help.sh index fdccabbf0..23c460afa 100755 --- a/scripts/help.sh +++ b/scripts/help.sh @@ -16,5 +16,6 @@ printf " play -> Run 3 fresh nodes so that you can test the com printf " dev -> Watch, run the livereload and run the server so that you can develop the application\n" printf " start -> Run the server\n" printf " check -> Check the server (according to NODE_ENV)\n" +printf " upgrade -- [branch] -> Upgrade the application according to the [branch] parameter\n" printf " test -> Run the tests\n" printf " help -> Print this help\n" diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh new file mode 100755 index 000000000..1299ac55a --- /dev/null +++ b/scripts/upgrade.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + + +git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1 + +if [[ `pgrep peertube` > /dev/null ]]; then + echo 'PeerTube is running!' + exit 0 +fi + +npm install +npm update +cd client && npm update && cd ../ +npm run build + +echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts." -- cgit v1.2.3