diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 14:23:20 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 14:23:20 +0200 |
commit | 9f540774b1fa2d9035a8b19dd1901247b112ead5 (patch) | |
tree | 4a3923e607bb9c479657985fca8bc807bc951523 | |
parent | 469526e14d9e0328f5baca90c9d09d173cb8a70a (diff) | |
download | PeerTube-9f540774b1fa2d9035a8b19dd1901247b112ead5.tar.gz PeerTube-9f540774b1fa2d9035a8b19dd1901247b112ead5.tar.zst PeerTube-9f540774b1fa2d9035a8b19dd1901247b112ead5.zip |
Add upgrade script
-rw-r--r-- | package.json | 1 | ||||
-rwxr-xr-x | scripts/help.sh | 1 | ||||
-rwxr-xr-x | scripts/upgrade.sh | 16 | ||||
-rw-r--r-- | server.js | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/package.json b/package.json index 8e2163bb2..93c748cd3 100644 --- a/package.json +++ b/package.json | |||
@@ -31,6 +31,7 @@ | |||
31 | "dev": "scripty", | 31 | "dev": "scripty", |
32 | "start": "node server", | 32 | "start": "node server", |
33 | "check": "scripty", | 33 | "check": "scripty", |
34 | "upgrade": "scripty", | ||
34 | "test": "scripty", | 35 | "test": "scripty", |
35 | "help": "scripty", | 36 | "help": "scripty", |
36 | "postinstall": "cd client && npm install" | 37 | "postinstall": "cd client && npm install" |
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 | |||
16 | printf " dev -> Watch, run the livereload and run the server so that you can develop the application\n" | 16 | printf " dev -> Watch, run the livereload and run the server so that you can develop the application\n" |
17 | printf " start -> Run the server\n" | 17 | printf " start -> Run the server\n" |
18 | printf " check -> Check the server (according to NODE_ENV)\n" | 18 | printf " check -> Check the server (according to NODE_ENV)\n" |
19 | printf " upgrade -- [branch] -> Upgrade the application according to the [branch] parameter\n" | ||
19 | printf " test -> Run the tests\n" | 20 | printf " test -> Run the tests\n" |
20 | printf " help -> Print this help\n" | 21 | 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 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | |||
3 | |||
4 | git pull origin $(git rev-parse --abbrev-ref HEAD) || exit -1 | ||
5 | |||
6 | if [[ `pgrep peertube` > /dev/null ]]; then | ||
7 | echo 'PeerTube is running!' | ||
8 | exit 0 | ||
9 | fi | ||
10 | |||
11 | npm install | ||
12 | npm update | ||
13 | cd client && npm update && cd ../ | ||
14 | npm run build | ||
15 | |||
16 | echo "\n\nUpgrade finished! You can restart PeerTube that may run the migration scripts." | ||
@@ -11,6 +11,8 @@ const path = require('path') | |||
11 | const TrackerServer = require('bittorrent-tracker').Server | 11 | const TrackerServer = require('bittorrent-tracker').Server |
12 | const WebSocketServer = require('ws').Server | 12 | const WebSocketServer = require('ws').Server |
13 | 13 | ||
14 | process.title = 'peertube' | ||
15 | |||
14 | // Create our main app | 16 | // Create our main app |
15 | const app = express() | 17 | const app = express() |
16 | 18 | ||