diff --git a/changelog.d/20231205_164707_regis_fix_3rd_party_build.md b/changelog.d/20231205_164707_regis_fix_3rd_party_build.md new file mode 100644 index 0000000..587b36c --- /dev/null +++ b/changelog.d/20231205_164707_regis_fix_3rd_party_build.md @@ -0,0 +1 @@ +- [Bugfix] Fix image build/pull/push when 3rd-party microfrontends are bind-mounted. (by @regisb) diff --git a/tutormfe/plugin.py b/tutormfe/plugin.py index 3b5acac..5ca9221 100644 --- a/tutormfe/plugin.py +++ b/tutormfe/plugin.py @@ -160,19 +160,21 @@ def get_mfe(mfe_name: str) -> MFE_ATTRS_TYPE: # Build, pull and push {mfe}-dev images -for mfe_name, mfe_attrs in iter_mfes(): - name = f"{mfe_name}-dev" - tag = "{{ DOCKER_REGISTRY }}overhangio/openedx-" + name + ":{{ MFE_VERSION }}" - tutor_hooks.Filters.IMAGES_BUILD.add_item( - ( - name, - os.path.join("plugins", "mfe", "build", "mfe"), - tag, - (f"--target={mfe_name}-dev",), +@tutor_hooks.Actions.PLUGINS_LOADED.add() +def _mounted_mfe_image_management() -> None: + for mfe_name, _mfe_attrs in iter_mfes(): + name = f"{mfe_name}-dev" + tag = "{{ DOCKER_REGISTRY }}overhangio/openedx-" + name + ":{{ MFE_VERSION }}" + tutor_hooks.Filters.IMAGES_BUILD.add_item( + ( + name, + os.path.join("plugins", "mfe", "build", "mfe"), + tag, + (f"--target={mfe_name}-dev",), + ) ) - ) - tutor_hooks.Filters.IMAGES_PULL.add_item((name, tag)) - tutor_hooks.Filters.IMAGES_PUSH.add_item((name, tag)) + tutor_hooks.Filters.IMAGES_PULL.add_item((name, tag)) + tutor_hooks.Filters.IMAGES_PUSH.add_item((name, tag)) # init script