diff options
author | Léo Andrès <leo@ndrs.fr> | 2018-03-27 09:35:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-27 10:35:12 +0200 |
commit | 0e4ffb4b678962d5ff7a4a7d8952033bc84725da (patch) | |
tree | b116dfe4244f645aa1c4740039544010ef7c3194 /scripts/upgrade.sh | |
parent | d5b7d9110dd637a7f67ce9e430145314812a8df1 (diff) | |
download | PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.tar.gz PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.tar.zst PeerTube-0e4ffb4b678962d5ff7a4a7d8952033bc84725da.zip |
Clean shell scripts (#398)
Diffstat (limited to 'scripts/upgrade.sh')
-rwxr-xr-x | scripts/upgrade.sh | 18 |
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 | 3 | set -eu |
4 | set -e | ||
5 | 4 | ||
6 | # Backup database | 5 | # Backup database |
7 | SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +\"%Y%m%d-%H%M\").bak" | 6 | SQL_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 |
12 | VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) | 11 | VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) |
13 | echo "Latest Peertube version is $VERSION" | 12 | echo "Latest Peertube version is $VERSION" |
14 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O /var/www/peertube/versions/peertube-${VERSION}.zip | 13 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "/var/www/peertube/versions/peertube-${VERSION}.zip" |
15 | cd /var/www/peertube/versions | 14 | cd /var/www/peertube/versions |
16 | unzip -o peertube-${VERSION}.zip | 15 | unzip -o "peertube-${VERSION}.zip" |
17 | rm -f peertube-${VERSION}.zip | 16 | rm -f "peertube-${VERSION}.zip" |
18 | 17 | ||
19 | # Upgrade Scripts | 18 | # Upgrade Scripts |
20 | rm -rf /var/www/peertube/peertube-latest | 19 | rm -rf /var/www/peertube/peertube-latest |
21 | ln -s /var/www/peertube/versions/peertube-${VERSION} /var/www/peertube/peertube-latest | 20 | ln -s "/var/www/peertube/versions/peertube-${VERSION}" /var/www/peertube/peertube-latest |
22 | cd /var/www/peertube/peertube-latest | 21 | cd /var/www/peertube/peertube-latest |
23 | yarn install --production --pure-lockfile | 22 | yarn install --production --pure-lockfile |
24 | cp /var/www/peertube/peertube-latest/config/default.yaml /var/www/peertube/config/default.yaml | 23 | cp /var/www/peertube/peertube-latest/config/default.yaml /var/www/peertube/config/default.yaml |
25 | 24 | ||
26 | echo "Differences in configuration files..." | 25 | echo "Differences in configuration files..." |
27 | diff /var/www/peertube/versions/peertube-${VERSION}/config/production.yaml.example /var/www/peertube/config/production.yaml | 26 | diff "/var/www/peertube/versions/peertube-${VERSION}/config/production.yaml.example" /var/www/peertube/config/production.yaml |
28 | 27 | ||
29 | exit 0 | ||