diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-28 15:54:18 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-28 15:54:18 +0200 |
commit | 86dc0b9cc9374cba7548bb613ff43d92f90570a8 (patch) | |
tree | 7e9d2ed2701d552ba0bb0d31743614ce94496ea3 /scripts | |
parent | 1025ce5df9f5cfa7b96f9712c91d1de6bc699f71 (diff) | |
download | PeerTube-86dc0b9cc9374cba7548bb613ff43d92f90570a8.tar.gz PeerTube-86dc0b9cc9374cba7548bb613ff43d92f90570a8.tar.zst PeerTube-86dc0b9cc9374cba7548bb613ff43d92f90570a8.zip |
Fix upgrade script
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/upgrade.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index 64a7b18fd..12629ad65 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh | |||
@@ -33,15 +33,15 @@ fi | |||
33 | 33 | ||
34 | # Backup database | 34 | # Backup database |
35 | if [ -x "$(command -v pg_dump)" ] | 35 | if [ -x "$(command -v pg_dump)" ] |
36 | then | 36 | then |
37 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" | 37 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" |
38 | DB_USER=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['username'])") | 38 | DB_USER=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['username'])") |
39 | DB_PASS=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['password'])") | 39 | DB_PASS=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['password'])") |
40 | DB_HOST=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['hostname'])") | 40 | DB_HOST=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['hostname'])") |
41 | DB_SUFFIX=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['suffix'])") | 41 | DB_SUFFIX=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['suffix'])") |
42 | DB_NAME=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['name'] || '')") | 42 | DB_NAME=$(node -e "console.log(require('js-yaml').load(fs.readFileSync('$PEERTUBE_PATH/config/production.yaml', 'utf8'))['database']['name'] || '')") |
43 | mkdir -p $PEERTUBE_PATH/backup | 43 | mkdir -p $PEERTUBE_PATH/backup |
44 | PGPASSWORD=$DB_PASS pg_dump -U $DB_USER -h $DB_HOST -F c "${DB_NAME:-'peertube${DB_SUFFIX}'}" -f "$SQL_BACKUP_PATH" | 44 | PGPASSWORD=$DB_PASS pg_dump -U $DB_USER -h $DB_HOST -F c "${DB_NAME:-peertube${DB_SUFFIX}}" -f "$SQL_BACKUP_PATH" |
45 | else | 45 | else |
46 | echo "pg_dump not found. Cannot make a SQL backup!" | 46 | echo "pg_dump not found. Cannot make a SQL backup!" |
47 | fi | 47 | fi |
@@ -72,7 +72,7 @@ rm -f "peertube-${VERSION}.zip" | |||
72 | rm -rf $PEERTUBE_PATH/peertube-latest | 72 | rm -rf $PEERTUBE_PATH/peertube-latest |
73 | ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest | 73 | ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest |
74 | cd $PEERTUBE_PATH/peertube-latest | 74 | cd $PEERTUBE_PATH/peertube-latest |
75 | yarn install --production --pure-lockfile | 75 | yarn install --production --pure-lockfile |
76 | cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml | 76 | cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml |
77 | 77 | ||
78 | echo "Differences in configuration files..." | 78 | echo "Differences in configuration files..." |