diff options
author | Felix Ableitner <me@nutomic.com> | 2018-09-26 19:48:21 -0500 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-28 10:35:59 +0200 |
commit | 4cd7a103da0ce773745b55e3ce3f8182260118ae (patch) | |
tree | 168b984d6482aa562261bf4cc1a2c70e86e0edc4 /scripts/upgrade.sh | |
parent | c39e86b898370a55c147ed1958db00723b0364e4 (diff) | |
download | PeerTube-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-x | scripts/upgrade.sh | 18 |
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"). | |||
26 | mkdir -p $PEERTUBE_PATH/backup | 26 | mkdir -p $PEERTUBE_PATH/backup |
27 | pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" | 27 | pg_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. |
30 | VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) | 30 | RELEASE_VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) |
31 | echo "Latest Peertube version is $VERSION" | 31 | PRE_RELEASE_VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases | grep tag_name | head -1 | cut -d '"' -f 4) |
32 | |||
33 | if [ "$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 | ||
41 | fi | ||
42 | |||
43 | echo "Installing Peertube version $VERSION" | ||
32 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip" | 44 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip" |
33 | cd $PEERTUBE_PATH/versions | 45 | cd $PEERTUBE_PATH/versions |
34 | unzip -o "peertube-${VERSION}.zip" | 46 | unzip -o "peertube-${VERSION}.zip" |