Commit 41e4fbaf by David Ormsbee

Consolidate edxapp update assets scripts.

The asset compilation scripts edxapp-update-assets-lms and
edxapp-update-assets-cms duplicate a lot of work between them. Running
webpack twice also seems to cause an intermittent error where the
second build results in a different bundle hash than the first.

It is possible to run "paver update_assets" without specifying "lms" or
"cms", in which case it just compiles it all at the same time. This
removes the duplicate invocations of webpack and should speed the build
overall.
parent c516cab1
......@@ -887,7 +887,6 @@ edxapp_aa_command: "{% if EDXAPP_SANDBOX_ENFORCE %}aa-enforce{% else %}aa-compla
edxapp_helper_scripts:
- edxapp-migrate
- edxapp-runserver
- edxapp-update-assets
- edxapp-shell
edxapp_environment_default:
......
......@@ -108,6 +108,16 @@
- install
- install:configuration
- name: create script to compile and update assets
template:
src: "edx/bin/edxapp-update-assets.j2"
dest: "{{ COMMON_BIN_DIR }}/edxapp-update-assets"
owner: "{{ edxapp_user }}"
mode: 0755
tags:
- install
- install:configuration
# migrate when the migrate user is overridden in extra vars
- name: migrate
command: "{{ COMMON_BIN_DIR }}/edxapp-migrate-{{ item }}"
......@@ -139,10 +149,9 @@
- assets
# Gather assets using paver if possible
- name: "gather {{ item }} static assets with paver"
command: "{{ COMMON_BIN_DIR }}/edxapp-update-assets-{{ item }}"
when: celery_worker is not defined and not devstack and item != "lms-preview"
with_items: "{{ service_variants_enabled }}"
- name: "gather static assets with paver"
command: "{{ COMMON_BIN_DIR }}/edxapp-update-assets"
when: celery_worker is not defined and not devstack
tags:
- gather_static_assets
- assets
{% include "edxapp_common.j2" %}
sudo -E -H -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin }}/paver update_assets lms --settings $EDX_PLATFORM_SETTINGS
{% include "edxapp_common.j2" %}
sudo -E -H -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin }}/paver update_assets cms --settings $EDX_PLATFORM_SETTINGS
sudo -E -H -u {{ edxapp_user }} env "PATH=$PATH" {{ edxapp_venv_bin }}/paver update_assets --settings $EDX_PLATFORM_SETTINGS
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