From 1471aca5cd32a09eb35d776b65c274ddafbdd578 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Mon, 9 Jan 2023 20:52:44 +0530 Subject: [PATCH] feat: allow remove git remote for custom image --- images/custom/Containerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/custom/Containerfile b/images/custom/Containerfile index 73fee57a..c6ea9eb4 100644 --- a/images/custom/Containerfile +++ b/images/custom/Containerfile @@ -93,6 +93,7 @@ RUN if [ -n "${APPS_JSON_BASE64}" ]; then \ USER frappe +ARG REMOVE_GIT_REMOTE ARG FRAPPE_BRANCH=version-14 ARG FRAPPE_PATH=https://github.com/frappe/frappe RUN export APP_INSTALL_ARGS="" && \ @@ -111,7 +112,9 @@ RUN export APP_INSTALL_ARGS="" && \ cd /home/frappe/frappe-bench && \ echo "$(jq 'del(.db_host, .redis_cache, .redis_queue, .redis_socketio)' sites/common_site_config.json)" \ > sites/common_site_config.json && \ - find /home/frappe/frappe-bench/apps -mindepth 1 -path "*/.git" | xargs rm -fr + if [ -n "${REMOVE_GIT_REMOTE}" ]; then \ + find apps -name .git -type d -prune | xargs -i git --git-dir {} remote rm upstream; \ + fi WORKDIR /home/frappe/frappe-bench