aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/upgrade.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh
index feb3091a8..abb7e9414 100755
--- a/scripts/upgrade.sh
+++ b/scripts/upgrade.sh
@@ -2,26 +2,28 @@
2 2
3set -eu 3set -eu
4 4
5PEERTUBE_PATH=/var/www/peertube/
6
5# Backup database 7# Backup database
6SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" 8SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak"
7mkdir -p /var/www/peertube/backup 9mkdir -p $PEERTUBE_PATH/backup
8pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" 10pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH"
9 11
10# Get and Display the Latest Version 12# Get and Display the Latest Version
11VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) 13VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4)
12echo "Latest Peertube version is $VERSION" 14echo "Latest Peertube version is $VERSION"
13wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "/var/www/peertube/versions/peertube-${VERSION}.zip" 15wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip"
14cd /var/www/peertube/versions 16cd $PEERTUBE_PATH/versions
15unzip -o "peertube-${VERSION}.zip" 17unzip -o "peertube-${VERSION}.zip"
16rm -f "peertube-${VERSION}.zip" 18rm -f "peertube-${VERSION}.zip"
17 19
18# Upgrade Scripts 20# Upgrade Scripts
19rm -rf /var/www/peertube/peertube-latest 21rm -rf $PEERTUBE_PATH/peertube-latest
20ln -s "/var/www/peertube/versions/peertube-${VERSION}" /var/www/peertube/peertube-latest 22ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest
21cd /var/www/peertube/peertube-latest 23cd $PEERTUBE_PATH/peertube-latest
22yarn install --production --pure-lockfile 24yarn install --production --pure-lockfile
23cp /var/www/peertube/peertube-latest/config/default.yaml /var/www/peertube/config/default.yaml 25cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml
24 26
25echo "Differences in configuration files..." 27echo "Differences in configuration files..."
26diff "/var/www/peertube/versions/peertube-${VERSION}/config/production.yaml.example" /var/www/peertube/config/production.yaml 28diff "$PEERTUBE_PATH/versions/peertube-${VERSION}/config/production.yaml.example" $PEERTUBE_PATH/config/production.yaml
27 29