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, 15 insertions, 3 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh
index 295e16bfd..0ff755b45 100755
--- a/scripts/upgrade.sh
+++ b/scripts/upgrade.sh
@@ -26,9 +26,21 @@ SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").
26mkdir -p $PEERTUBE_PATH/backup 26mkdir -p $PEERTUBE_PATH/backup
27pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" 27pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH"
28 28
29# Get and Display the Latest Version 29# If there is a pre-release, give the user a choice which one to install.
30VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) 30RELEASE_VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4)
31echo "Latest Peertube version is $VERSION" 31PRE_RELEASE_VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases | grep tag_name | head -1 | cut -d '"' -f 4)
32
33if [ "$RELEASE_VERSION" != "$PRE_RELEASE_VERSION" ]; then
34 echo -e "Which version do you want to install?\n[1] $RELEASE_VERSION (stable) \n[2] $PRE_RELEASE_VERSION (pre-release)"
35 read choice
36 case $choice in
37 [1]* ) VERSION="$RELEASE_VERSION";;
38 [2]* ) VERSION="$PRE_RELEASE_VERSION";;
39 * ) exit;
40 esac
41fi
42
43echo "Installing Peertube version $VERSION"
32wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip" 44wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip"
33cd $PEERTUBE_PATH/versions 45cd $PEERTUBE_PATH/versions
34unzip -o "peertube-${VERSION}.zip" 46unzip -o "peertube-${VERSION}.zip"