From cb49bfd8141421edc971c43a43649a9d9b2d6299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 4 Jul 2019 16:45:15 +0800 Subject: [PATCH] Make it possible to patch build templates Thus, build templates are no longer copied, but rendered. --- CHANGELOG.md | 1 + tutor/env.py | 3 +-- tutor/templates/build/openedx/Dockerfile | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a42006..c148871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥". ## Latest +- [Feature] Make it possible for plugins to patch the build templates - [Improvement] Move Xqueue and Student notes to a dedicated plugin ## 3.4.3 (2019-06-24) diff --git a/tutor/env.py b/tutor/env.py index 4a1c3b7..f9f4e50 100644 --- a/tutor/env.py +++ b/tutor/env.py @@ -102,11 +102,10 @@ def render_full(root, config): """ Render the full environment, including version information. """ - for subdir in ["android", "apps", "k8s", "local", "webui"]: + for subdir in ["android", "apps", "build", "k8s", "local", "webui"]: save_subdir(subdir, root, config) for plugin, path in plugins.iter_templates(config): save_plugin_templates(plugin, path, root, config) - copy_subdir("build", root) save_file(VERSION_FILENAME, root, config) save_file("kustomization.yml", root, config) diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index d153b00..b59782e 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -69,6 +69,8 @@ COPY settings/cms/*.py ./cms/envs/tutor/ COPY ./bin /openedx/bin ENV PATH /openedx/bin:${PATH} +{{ patch("openedx-dockerfile-pre-assets") }} + # Collect production assets. By default, only assets from the default theme # will be processed. This makes the docker image lighter and faster to build. # Only the custom themes added to /openedx/themes will be compiled. @@ -91,6 +93,8 @@ RUN mkdir /openedx/data ENV SERVICE_VARIANT lms ENV SETTINGS tutor.production +{{ patch("openedx-dockerfile") }} + # Entrypoint will fix permissions of all files and run commands as openedx ENTRYPOINT ["docker-entrypoint.sh"]