Commit 9f67f7d5 by Feanil Patel

Update to have a new flag for updating the staticfiles KEY_PREFIX.

parent a668b86e
...@@ -147,6 +147,8 @@ EDXAPP_LOCAL_GIT_IDENTITY: !!null ...@@ -147,6 +147,8 @@ EDXAPP_LOCAL_GIT_IDENTITY: !!null
# Configuration for database migration # Configuration for database migration
EDXAPP_TEST_MIGRATE_DB_NAME: "{{ COMMON_ENVIRONMENT }}_{{ COMMON_DEPLOYMENT }}_test_{{ EDXAPP_MYSQL_DB_NAME }}" EDXAPP_TEST_MIGRATE_DB_NAME: "{{ COMMON_ENVIRONMENT }}_{{ COMMON_DEPLOYMENT }}_test_{{ EDXAPP_MYSQL_DB_NAME }}"
EDXAPP_UPDATE_STATIC_FILES_KEY: false
#-------- Everything below this line is internal to the role ------------ #-------- Everything below this line is internal to the role ------------
#Use YAML references (& and *) and hash merge <<: to factor out shared settings #Use YAML references (& and *) and hash merge <<: to factor out shared settings
......
...@@ -10,16 +10,16 @@ ...@@ -10,16 +10,16 @@
- name: Get current time - name: Get current time
shell: 'date +%s' shell: 'date +%s'
register: time_in_seconds register: time_in_seconds
when: EDXAPP_UPDATE_STATIC_FILES_KEY
- name: Update the static_files_key_prefix - name: Update the static_files_key_prefix
set_fact: set_fact:
EDXAPP_ENV_EXTRA: edxapp_dynamic_cache_key: '{{time_in_seconds.stdout}}'
CACHES: when: EDXAPP_UPDATE_STATIC_FILES_KEY
staticfiles:
KEY_PREFIX: '{{time_in_seconds.stdout}}'
- name: Print out the staticfiles prefix - name: Print out the staticfiles prefix
debug: msg="Setting static_files_cache_prefix to {{time_in_seconds.stdout}}" debug: msg="Setting static_files_cache_prefix to {{time_in_seconds.stdout}}"
when: EDXAPP_UPDATE_STATIC_FILES_KEY
# Optional auth for git # Optional auth for git
- name: create ssh script for git (not authenticated) - name: create ssh script for git (not authenticated)
......
{% do lms_env_config.update(EDXAPP_ENV_EXTRA) %} {% do lms_env_config.update(EDXAPP_ENV_EXTRA) %}
{% if EDXAPP_UPDATE_STATIC_FILES_KEY %}
{%- do lms_env_config['CACHES']['staticfiles'].update({'KEY_PREFIX': edxapp_dynamic_cache_key}) %}
{% endif %}
{{ lms_env_config | to_nice_json }} {{ lms_env_config | to_nice_json }}
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