]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - scripts/upgrade.sh
Add ability to set video thumbnail/preview
[github/Chocobozzz/PeerTube.git] / scripts / upgrade.sh
CommitLineData
64586951
SL
1#!/bin/bash
2
3### Note !! ###
4# On shell prompt do :
5#
6# $ su - peertube
7# $ ./upgrade.sh
8############
9
10# Stcict mode
11set -e
12
13# Backup database
14SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date -Im).bak"
15mkdir -p ~/backup
16pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH"
17
18# Get and Display the Latest Version
19VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4)
20echo "Latest Peertube version is $VERSION"
21wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O ~/versions/peertube-${VERSION}.zip
22cd ~/versions
23unzip -o peertube-${VERSION}.zip
24rm -f peertube-${VERSION}.zip
25
26# Upgrade Scripts
27rm -rf ~/peertube-latest
28ln -s ~/versions/peertube-${VERSION} ~/peertube-latest
29cd ~/peertube-latest
30yarn install --production --pure-lockfile
31cp ~/peertube-latest/config/default.yaml ~/config/default.yaml
32diff ~/peertube-latest/config/production.yaml.example ~/config/production.yaml
33
34exit 0