Add upgrade script

This commit is contained in:
Chocobozzz 2016-10-21 14:23:20 +02:00
parent 469526e14d
commit 9f540774b1
4 changed files with 20 additions and 0 deletions

View File

@ -31,6 +31,7 @@
"dev": "scripty", "dev": "scripty",
"start": "node server", "start": "node server",
"check": "scripty", "check": "scripty",
"upgrade": "scripty",
"test": "scripty", "test": "scripty",
"help": "scripty", "help": "scripty",
"postinstall": "cd client && npm install" "postinstall": "cd client && npm install"

View File

@ -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 " dev -> Watch, run the livereload and run the server so that you can develop the application\n"
printf " start -> Run the server\n" printf " start -> Run the server\n"
printf " check -> Check the server (according to NODE_ENV)\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 " test -> Run the tests\n"
printf " help -> Print this help\n" printf " help -> Print this help\n"

16
scripts/upgrade.sh Executable file
View File

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

View File

@ -11,6 +11,8 @@ const path = require('path')
const TrackerServer = require('bittorrent-tracker').Server const TrackerServer = require('bittorrent-tracker').Server
const WebSocketServer = require('ws').Server const WebSocketServer = require('ws').Server
process.title = 'peertube'
// Create our main app // Create our main app
const app = express() const app = express()