diff options
-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..." |