Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
8c6c1914
Commit
8c6c1914
authored
8 years ago
by
Sven Marnach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure Ansible notices migration errors.
parent
b554fb5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-cms.j2
+2
-2
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-lms.j2
+2
-2
playbooks/roles/edxapp/templates/edx/bin/edxapp_common.j2
+6
-2
No files found.
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-cms.j2
View file @
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 %}
This diff is collapsed.
Click to expand it.
playbooks/roles/edxapp/templates/edx/bin/edxapp-migrate-lms.j2
View file @
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 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 %}
This diff is collapsed.
Click to expand it.
playbooks/roles/edxapp/templates/edx/bin/edxapp_common.j2
View file @
8c6c1914
#!/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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment