aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/upgrade.sh
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2018-09-26 19:48:21 -0500
committerChocobozzz <me@florianbigard.com>2018-09-28 10:35:59 +0200
commit4cd7a103da0ce773745b55e3ce3f8182260118ae (patch)
tree168b984d6482aa562261bf4cc1a2c70e86e0edc4 /scripts/upgrade.sh
parentc39e86b898370a55c147ed1958db00723b0364e4 (diff)
downloadPeerTube-4cd7a103da0ce773745b55e3ce3f8182260118ae.tar.gz
PeerTube-4cd7a103da0ce773745b55e3ce3f8182260118ae.tar.zst
PeerTube-4cd7a103da0ce773745b55e3ce3f8182260118ae.zip
Add prompt to upgrade.sh to install pre-release version
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"