diff options
author | Jocelyn Jaubert <jocelyn.jaubert@gmail.com> | 2018-05-21 21:48:10 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-22 08:08:40 +0200 |
commit | ee1219d83d4d3c6c59236c2e854e6b3ff36fa30f (patch) | |
tree | b9cc96d88953de93483bff37b5a67fcbf8b1611a /scripts | |
parent | 30c82f0d2e9adacc1d3398822aa7810c0ccbceb4 (diff) | |
download | PeerTube-ee1219d83d4d3c6c59236c2e854e6b3ff36fa30f.tar.gz PeerTube-ee1219d83d4d3c6c59236c2e854e6b3ff36fa30f.tar.zst PeerTube-ee1219d83d4d3c6c59236c2e854e6b3ff36fa30f.zip |
Move /var/www/peertube to $PEERTUBE_PATH in upgrade.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/upgrade.sh | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index feb3091a8..abb7e9414 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -2,26 +2,28 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | PEERTUBE_PATH=/var/www/peertube/ | ||
6 | |||
5 | # Backup database | 7 | # Backup database |
6 | SQL_BACKUP_PATH="/var/www/peertube/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" | 8 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" |
7 | mkdir -p /var/www/peertube/backup | 9 | mkdir -p $PEERTUBE_PATH/backup |
8 | pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" | 10 | pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" |
9 | 11 | ||
10 | # Get and Display the Latest Version | 12 | # Get and Display the Latest Version |
11 | VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) | 13 | VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) |
12 | echo "Latest Peertube version is $VERSION" | 14 | echo "Latest Peertube version is $VERSION" |
13 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "/var/www/peertube/versions/peertube-${VERSION}.zip" | 15 | wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" -O "$PEERTUBE_PATH/versions/peertube-${VERSION}.zip" |
14 | cd /var/www/peertube/versions | 16 | cd $PEERTUBE_PATH/versions |
15 | unzip -o "peertube-${VERSION}.zip" | 17 | unzip -o "peertube-${VERSION}.zip" |
16 | rm -f "peertube-${VERSION}.zip" | 18 | rm -f "peertube-${VERSION}.zip" |
17 | 19 | ||
18 | # Upgrade Scripts | 20 | # Upgrade Scripts |
19 | rm -rf /var/www/peertube/peertube-latest | 21 | rm -rf $PEERTUBE_PATH/peertube-latest |
20 | ln -s "/var/www/peertube/versions/peertube-${VERSION}" /var/www/peertube/peertube-latest | 22 | ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest |
21 | cd /var/www/peertube/peertube-latest | 23 | cd $PEERTUBE_PATH/peertube-latest |
22 | yarn install --production --pure-lockfile | 24 | yarn install --production --pure-lockfile |
23 | cp /var/www/peertube/peertube-latest/config/default.yaml /var/www/peertube/config/default.yaml | 25 | cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml |
24 | 26 | ||
25 | echo "Differences in configuration files..." | 27 | echo "Differences in configuration files..." |
26 | diff "/var/www/peertube/versions/peertube-${VERSION}/config/production.yaml.example" /var/www/peertube/config/production.yaml | 28 | diff "$PEERTUBE_PATH/versions/peertube-${VERSION}/config/production.yaml.example" $PEERTUBE_PATH/config/production.yaml |
27 | 29 | ||