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