Skip to content

Commit

Permalink
fix: set environment variables for whole file.
Browse files Browse the repository at this point in the history
Setting environment variables in the previous way did not seem to carry
through to all of the parts of the command.
  • Loading branch information
dianakhuang committed Dec 13, 2024
1 parent ab7be14 commit b6cb1da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{% include "edxapp_common.j2" %}

export WEBPACK_CONFIG_PATH=webpack.prod.config.js
export STATIC_ROOT_LMS=/edx/var/edxapp/staticfiles
export STATIC_ROOT_CMS=/edx/var/edxapp/staticfiles/studio

{% if edxapp_staticfiles_storage_overrides %}
{% for override in edxapp_staticfiles_storage_overrides %}
export STATICFILES_STORAGE={{ override }}
sudo -E -H -u {{ edxapp_user }} \
env "PATH=$PATH" \
"WEBPACK_CONFIG_PATH=webpack.prod.config.js" \
"STATIC_ROOT_LMS=/edx/var/edxapp/staticfiles" \
"STATIC_ROOT_CMS=/edx/var/edxapp/staticfiles/studio" \
npm install \
&& npm run webpack \
&& npm run compile-sass -- --theme-dir /edx/var/edx-themes/edx-themes/edx-platform --theme-dir /edx/app/edxapp/edx-platform/themes \
Expand All @@ -16,9 +18,6 @@ sudo -E -H -u {{ edxapp_user }} \
{% else %}
sudo -E -H -u {{ edxapp_user }} \
env "PATH=$PATH" \
"WEBPACK_CONFIG_PATH=webpack.prod.config.js" \
"STATIC_ROOT_LMS=/edx/var/edxapp/staticfiles" \
"STATIC_ROOT_CMS=/edx/var/edxapp/staticfiles/studio" \
npm install \
&& npm run webpack \
&& npm run compile-sass -- --theme-dir /edx/var/edx-themes/edx-themes/edx-platform --theme-dir /edx/app/edxapp/edx-platform/themes \
Expand Down

0 comments on commit b6cb1da

Please sign in to comment.