Commit cd408f19 by Sven Marnach Committed by GitHub

Merge pull request #3481 from open-craft/smarnach/migration-scripts

Make sure Ansible notices migration errors.
parents b554fb5e 8c6c1914
{% include "edxapp_common.j2" %}
if [[ -z "$NO_EDXAPP_SUDO" ]]; then
if [[ -z "${NO_EDXAPP_SUDO:-}" ]]; then
SUDO='sudo -E -u {{ edxapp_user }} env "PATH=$PATH"'
fi
{% for db in cms_auth_config.DATABASES.keys() %}
{%- if db != 'read_replica' %}
$SUDO {{ edxapp_venv_bin}}/python manage.py cms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py cms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
{% endif %}
{% endfor %}
{% include "edxapp_common.j2" %}
if [[ -z "$NO_EDXAPP_SUDO" ]]; then
if [[ -z "${NO_EDXAPP_SUDO:-}" ]]; then
SUDO='sudo -E -u {{ edxapp_user }} env "PATH=$PATH"'
fi
{% for db in lms_auth_config.DATABASES.keys() %}
{%- if db != 'read_replica' %}
$SUDO {{ edxapp_venv_bin}}/python manage.py lms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
${SUDO:-} {{ edxapp_venv_bin }}/python manage.py lms migrate --database {{ db }} --noinput --settings $EDX_PLATFORM_SETTINGS $@
{% endif %}
{% endfor %}
#!/bin/bash
# Error out when any command fails. For the migration scripts migrating multiple
# databases this ensure migration errors for any database will be seen by Ansible.
set -euo pipefail
cd {{ edxapp_code_dir }}
source {{ edxapp_app_dir }}/edxapp_env
# The default settings set in edxapp_env can be overridden
# using the var $EDX_PLATFORM_SETTINGS_OVERRIDE
if [[ -n "$EDX_PLATFORM_SETTINGS_OVERRIDE" ]]; then
if [[ -n "${EDX_PLATFORM_SETTINGS_OVERRIDE:-}" ]]; then
export EDX_PLATFORM_SETTINGS="$EDX_PLATFORM_SETTINGS_OVERRIDE"
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment