-
Notifications
You must be signed in to change notification settings - Fork 0
/
openedx-dockerfile-pre-assets
40 lines (37 loc) · 1.73 KB
/
openedx-dockerfile-pre-assets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{% if TUTOR_VERSION is defined and PICASSO_THEME_DIRS is defined and PICASSO_THEMES_NAME is defined %}
{% set redwood_version = 'v18.0.0'.lstrip('v').split('.') %}
{% set current_version = TUTOR_VERSION.lstrip('v').split('.') %}
{% set redwood_version = redwood_version | map('int') | list %}
{% set current_version = current_version | map('int') | list %}
COPY --chown=app:app ./themes/ /openedx/themes
{% if (current_version[0] < redwood_version[0]) %}
# This compiles the Picasso themes assets in the releases < redwood.
# These commands are already in the Dockerfile Tutor template,
# but we needed them for the Picasso themes compilation.
ENV NO_PYTHON_UNINSTALL 1
ENV NO_PREREQ_INSTALL 1
RUN openedx-assets xmodule \
&& openedx-assets npm \
&& openedx-assets webpack --env=prod \
&& openedx-assets common
# Compiling the Picasso themes.
RUN openedx-assets themes \
--theme-dirs {{ PICASSO_THEME_DIRS | join(' ') }} \
--themes {{ PICASSO_THEMES_NAME | join(' ') }} \
&& openedx-assets collect --settings=tutor.assets \
&& rdfind -makesymlinks true -followsymlinks true /openedx/staticfiles/
{% else %}
# This compiles the Picasso themes assets from the redwood release.
# These commands are already in the Dockerfile Tutor template,
# but we needed them for the Picasso themes compilation.
RUN npm run postinstall
RUN npm run compile-sass -- --skip-themes
RUN npm run webpack
# Compiling the Picasso themes.
RUN npm run compile-sass -- \
--theme-dir {{ PICASSO_THEME_DIRS | join(' --theme-dir ') }} \
--theme {{ PICASSO_THEMES_NAME | join(' --theme ') }} \
&& ./manage.py lms collectstatic --noinput --settings=tutor.assets \
&& rdfind -makesymlinks true -followsymlinks true /openedx/staticfiles/
{% endif %}
{% endif %}