aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/upgrade.sh
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-28 15:54:18 +0200
committerChocobozzz <me@florianbigard.com>2021-05-28 15:54:18 +0200
commit86dc0b9cc9374cba7548bb613ff43d92f90570a8 (patch)
tree7e9d2ed2701d552ba0bb0d31743614ce94496ea3 /scripts/upgrade.sh
parent1025ce5df9f5cfa7b96f9712c91d1de6bc699f71 (diff)
downloadPeerTube-86dc0b9cc9374cba7548bb613ff43d92f90570a8.tar.gz
PeerTube-86dc0b9cc9374cba7548bb613ff43d92f90570a8.tar.zst
PeerTube-86dc0b9cc9374cba7548bb613ff43d92f90570a8.zip
Fix upgrade script
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..."