From 510b678dc6851de85e166e940475fb749daf7076 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 15 Jul 2021 10:16:17 +0100 Subject: [PATCH] Add init script to run migrations from web --- server-ce/init_scripts/99_run_web_migrations.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 server-ce/init_scripts/99_run_web_migrations.sh diff --git a/server-ce/init_scripts/99_run_web_migrations.sh b/server-ce/init_scripts/99_run_web_migrations.sh new file mode 100755 index 0000000000..a94ce18602 --- /dev/null +++ b/server-ce/init_scripts/99_run_web_migrations.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ "${SHARELATEX_IS_SERVER_PRO:-null}" == "true" ]]; then + environment="server-pro" +else + environment="server-ce" +fi + +echo "Running migrations for $environment" +cd /var/www/sharelatex/web +npm run migrations -- migrate -t "$environment" +echo "Finished migrations"