diff --git a/changelog.d/20231126_114050_shadinaif_atlas_pull.md b/changelog.d/20231126_114050_shadinaif_atlas_pull.md new file mode 100644 index 0000000..9a03851 --- /dev/null +++ b/changelog.d/20231126_114050_shadinaif_atlas_pull.md @@ -0,0 +1 @@ +- [Feature] Pull translations via `atlas` during Docker build. (by @shadinaif) diff --git a/tutorcredentials/plugin.py b/tutorcredentials/plugin.py index de74323..c033a9e 100644 --- a/tutorcredentials/plugin.py +++ b/tutorcredentials/plugin.py @@ -54,6 +54,7 @@ "TOS_URL": "{{ LMS_HOST }}/tos", "REPOSITORY": "https://github.com/openedx/credentials.git", "REPOSITORY_VERSION": "{{ OPENEDX_COMMON_VERSION }}", + "ATLAS_PULL": False, }, "unique": { "MYSQL_PASSWORD": "{{ 8|random_string }}", diff --git a/tutorcredentials/templates/credentials/build/credentials/Dockerfile b/tutorcredentials/templates/credentials/build/credentials/Dockerfile index f6c3e05..2bbb9f7 100644 --- a/tutorcredentials/templates/credentials/build/credentials/Dockerfile +++ b/tutorcredentials/templates/credentials/build/credentials/Dockerfile @@ -101,6 +101,12 @@ RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip, {% for extra_requirement in CREDENTIALS_EXTRA_PIP_REQUIREMENTS %}RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install '{{ extra_requirement }}' {% endfor %} +{% if CREDENTIALS_ATLAS_PULL %} +# Pull translations. Support the OEP-58 proposal behind a feature flag until it's fully implemented. +RUN atlas pull {{ patch("atlas-extra-args") }} translations/credentials/credentials/conf/locale:credentials/conf/locale +RUN python manage.py compilemessages +{% endif %} + ###### Install nodejs with nodeenv in /openedx/nodeenv FROM python as nodejs-requirements ENV PATH /openedx/nodeenv/bin:/openedx/venv/bin:${PATH}