diff --git a/changelog.d/20240607_111921_regis_edx_platform_code_cache.md b/changelog.d/20240607_111921_regis_edx_platform_code_cache.md new file mode 100644 index 0000000000..f56c6f8dd3 --- /dev/null +++ b/changelog.d/20240607_111921_regis_edx_platform_code_cache.md @@ -0,0 +1 @@ +- 💥[Improvement] Ensure that the edx-platform repository git checkout is cached by Docker during image build. This means that the cache will automatically be cleared any time there is an upstream change. Thus, it is no longer necessary to run `tutor images build --no-cache` just to fetch the latest edx-platform changes. For this to work, any GitHub repository referenced by `EDX_PLATFORM_REPOSITORY` needs to end with ".git". Make sure that this is the case if you have modified the value of this setting in the past. (by @regisb) diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 4d7d8b0081..65b7e6a2da 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -38,9 +38,9 @@ RUN $PYENV_ROOT/versions/$PYTHON_VERSION/bin/python -m venv /openedx/venv FROM minimal as code ARG EDX_PLATFORM_REPOSITORY={{ EDX_PLATFORM_REPOSITORY }} ARG EDX_PLATFORM_VERSION={{ EDX_PLATFORM_VERSION }} -RUN mkdir -p /openedx/edx-platform && \ - git clone $EDX_PLATFORM_REPOSITORY --branch $EDX_PLATFORM_VERSION --depth 1 /openedx/edx-platform +RUN mkdir -p /openedx/edx-platform WORKDIR /openedx/edx-platform +ADD --keep-git-dir=true $EDX_PLATFORM_REPOSITORY#$EDX_PLATFORM_VERSION . # Identify tutor user to apply patches using git RUN git config --global user.email "tutor@overhang.io" \