mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 15:28:06 +02:00
Use server-pro flag in restore script
This commit is contained in:
parent
1aaa465b74
commit
7acd8e212e
1 changed files with 11 additions and 4 deletions
15
bin/restore
15
bin/restore
|
@ -17,6 +17,9 @@ fi
|
|||
|
||||
TMP_ROOT_DIR="$TOOLKIT_ROOT/tmp"
|
||||
|
||||
IS_SERVER_PRO="$(grep -q 'SERVER_PRO=true' \
|
||||
"$TOOLKIT_ROOT/config/overleaf.rc" && echo 'true' || echo 'false')"
|
||||
|
||||
function usage() {
|
||||
cat <<EOF
|
||||
Usage: bin/restore [latest | path/to/backup-file.tar.gz]
|
||||
|
@ -81,12 +84,16 @@ function restore-mongo () {
|
|||
cd /tmp && mongorestore --drop --quiet ./dump \
|
||||
&& rm -rf /tmp/dump;'
|
||||
|
||||
# TODO: select either server-ce or server-pro migrations
|
||||
## Run web migrations
|
||||
# shellcheck disable=SC1004
|
||||
"$TOOLKIT_ROOT/bin/docker-compose" exec sharelatex bash -lc '\
|
||||
local migration_tag='server-ce'
|
||||
if [[ "${IS_SERVER_PRO}" == "true" ]]; then
|
||||
migration_tag="server-pro"
|
||||
fi
|
||||
local migration_command="\
|
||||
cd /var/www/sharelatex/web && \
|
||||
if [[ -d migrations ]]; then npm run migrations -- migrate -t server-pro; fi'
|
||||
if [[ -d migrations ]]; then npm run migrations -- migrate -t ${migration_tag}; fi"
|
||||
|
||||
"$TOOLKIT_ROOT/bin/docker-compose" exec sharelatex bash -lc "$migration_command"
|
||||
|
||||
## Stop services again
|
||||
"$TOOLKIT_ROOT/bin/docker-compose" stop sharelatex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue