aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/upgrade.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/upgrade.sh')
-rwxr-xr-xscripts/upgrade.sh8
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
35if [ -x "$(command -v pg_dump)" ] 35if [ -x "$(command -v pg_dump)" ]
36then 36then
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"
45else 45else
46 echo "pg_dump not found. Cannot make a SQL backup!" 46 echo "pg_dump not found. Cannot make a SQL backup!"
47fi 47fi
@@ -72,7 +72,7 @@ rm -f "peertube-${VERSION}.zip"
72rm -rf $PEERTUBE_PATH/peertube-latest 72rm -rf $PEERTUBE_PATH/peertube-latest
73ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest 73ln -s "$PEERTUBE_PATH/versions/peertube-${VERSION}" $PEERTUBE_PATH/peertube-latest
74cd $PEERTUBE_PATH/peertube-latest 74cd $PEERTUBE_PATH/peertube-latest
75yarn install --production --pure-lockfile 75yarn install --production --pure-lockfile
76cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml 76cp $PEERTUBE_PATH/peertube-latest/config/default.yaml $PEERTUBE_PATH/config/default.yaml
77 77
78echo "Differences in configuration files..." 78echo "Differences in configuration files..."