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 d513bca
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions playbooks/roles/edxapp/templates/edx/bin/edxapp-update-assets.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{% 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 %}
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" \
env "PATH=$PATH" "STATICFILES_STORAGE={{ override }}" \
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 +17,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 d513bca

Please sign in to comment.