diff --git a/Dockerfile b/Dockerfile index 949882341d369c668863f3379fd781c07bd5681d..ef415c1061813ed8d16caddfe7297e3d207e701c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,10 @@ ENV RELEASE_TYPE 'UNOFFICIAL' # Repo use for build ENV REPO 'https://gitlab.e.foundation/e/os/android.git' +# Optional parameter to repo init --depth N +# A size of 0 deactivates --depth N +ENV REPO_INIT_DEPTH 0 + # User identity ENV USER_NAME '/e/ robot' ENV USER_MAIL 'erobot@e.email' diff --git a/src/build.sh b/src/build.sh index 912a40cd596eebad318bebf1931414902a240313..a146e8c4a98c5238f04d5ab8f0f5a1b7d98135e7 100755 --- a/src/build.sh +++ b/src/build.sh @@ -95,7 +95,10 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then echo "Branch name ${BRANCH_NAME} is a tag on e/os/releases, prefix with refs/tags/ for 'repo init'" TAG_PREFIX="refs/tags/" fi - yes | repo init -u "$REPO" -b "${TAG_PREFIX}${BRANCH_NAME}" + if [ -n ${REPO_INIT_DEPTH} ] && [ ${REPO_INIT_DEPTH} -gt 0 ]; then + REPO_INIT_PARAM="--depth ${REPO_INIT_DEPTH}" + fi + yes | repo init $REPO_INIT_PARAM -u "$REPO" -b "${TAG_PREFIX}${BRANCH_NAME}" # Copy local manifests to the appropriate folder in order take them into consideration echo ">> [$(date)] Copying '$LMANIFEST_DIR/*.xml' to '.repo/local_manifests/'"