From 3dc5d9b984c939463ad90ef27e161083cf5fc653 Mon Sep 17 00:00:00 2001 From: "Kyle D. McCormick" Date: Tue, 26 Mar 2024 16:32:29 -0400 Subject: [PATCH] build: clean_translations without .git We reimplement `make translations` so that it does not depend on the presence of the `.git` directory. This fixes the Tutor build error: > [production 18/34] RUN make clean_translations: git clean -fdX conf/locale fatal: not a git repository (or any of the parent directories): .git make: *** [Makefile:57: clean_translations] Error 128 Why is the .git directory missing during the Tutor translations build? Because if it were present, it would tie the translations' layer cache up with git state, which would lead to the Docker layer being rebuilt any time there was any change to git state. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c02dc239f..21e644c505 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,8 @@ pull_xblock_translations: ## pull xblock translations via atlas python manage.py cms compile_xblock_translations clean_translations: ## Remove existing translations to prepare for a fresh pull - git clean -fdX conf/locale # Removes core edx-platform translations but keeps Esperanto (eo) test translations + # Removes core edx-platform translations but keeps config files and Esperanto (eo) test translations + cd conf/locale && find . -type d -a ! -path . -a ! -path ./eo ! -path ./eo/* -exec rm -rf {} + # Removes the xblocks/plugins and js-compiled translations rm -rf conf/plugins-locale cms/static/js/i18n/ lms/static/js/i18n/ cms/static/js/xblock.v1-i18n/ lms/static/js/xblock.v1-i18n/