Commit 4ce88416 by John Jarvis

adding fake_migrations flag

parent 259d9977
......@@ -134,14 +134,9 @@ EDXAPP_AUTOMATOR_AUTHORIZED_KEYS: []
EDXAPP_USE_GIT_IDENTITY: false
# Example: "{{ secure_dir }}/files/git-identity"
EDXAPP_LOCAL_GIT_IDENTITY: !!null
# Configuration for database migration
EDXAPP_MIGRATE_ENGINE: django.db.backends.mysql
EDXAPP_MIGRATE_NAME: "{{ EDXAPP_MYSQL_DB_NAME }}"
EDXAPP_MIGRATE_USER: "{{ EDXAPP_MYSQL_USER }}"
EDXAPP_MIGRATE_PASSWORD: "{{ EDXAPP_MYSQL_PASSWORD }}"
EDXAPP_MIGRATE_HOST: "{{ EDXAPP_MYSQL_HOST }}"
EDXAPP_MIGRATE_PORT: "{{ EDXAPP_MYSQL_PORT }}"
# Configuration for database migration
EDXAPP_TEST_MIGRATE_DB_NAME: "{{ COMMON_ENVIRONMENT }}_{{ COMMON_DEPLOYMENT }}_test_{{ EDXAPP_MYSQL_DB_NAME }}"
#-------- Everything below this line is internal to the role ------------
......
......@@ -44,23 +44,59 @@
when: celery_worker is defined and not devstack
sudo_user: "{{ supervisor_user }}"
# Fake migrations, only when fake_migrations is defined
# This overrides the database name to be the test database which
# the default application user has full write access to
- name: syncdb and migrate
shell: >
chdir={{ edxapp_code_dir }}
{{ edxapp_venv_bin}}/python manage.py lms syncdb --migrate --noinput --settings=aws_migrate
when: migrate_db is defined and migrate_db|lower == "yes"
when: fake_migrations is defined and migrate_db is defined and migrate_db|lower == "yes"
sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_migrate_environment }}"
environment:
DB_MIGRATION_NAME: "{{ EDXAPP_TEST_MIGRATE_DB_NAME }}"
notify:
- "restart edxapp"
- "restart edxapp_workers"
# Regular migrations
- name: syncdb and migrate
shell: >
chdir={{ edxapp_code_dir }}
{{ edxapp_venv_bin}}/python manage.py lms syncdb --migrate --noinput --settings=aws_migrate
when: fake_migrations is not defined and migrate_db is defined and migrate_db|lower == "yes"
sudo_user: "{{ edxapp_user }}"
notify:
- "restart edxapp"
- "restart edxapp_workers"
# Fake migrations, only when fake_migrations is defined
# This overrides the database name to be the test database which
# the default application user has full write access to
- name: syncdb and migrate
shell: >
chdir={{ edxapp_code_dir }}
{{ edxapp_venv_bin}}/python manage.py lms syncdb --migrate --noinput --settings=aws_migrate
when: fake_migrations is defined and migrate_db is defined and migrate_db|lower == "yes"
sudo_user: "{{ edxapp_user }}"
environment:
DB_MIGRATION_NAME: "{{ EDXAPP_TEST_MIGRATE_DB_NAME }}"
notify:
- "restart edxapp"
- "restart edxapp_workers"
# Regular migrations
- name: db migrate
shell: >
chdir={{ edxapp_code_dir }}
{{ edxapp_venv_bin}}/python manage.py lms migrate --noinput --settings=aws_migrate
when: migrate_only is defined and migrate_only|lower == "yes"
when: fake_migrations is not defined and migrate_only is defined and migrate_only|lower == "yes"
sudo_user: "{{ edxapp_user }}"
notify:
- "restart edxapp"
- "restart edxapp_workers"
# Gather assets using rake if possible
......
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