Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f86cba1f authored by Micha M's avatar Micha M
Browse files

Add repo init --depth parameter



Using e.g.

  repo init --depth 1

saves a lot of bandwidth and disk space if you do not
need the git history. So allow the user to specify
the checkout depth by the REPO_INIT_DEPTH environment
variable. By default the full history is fetched.

Signed-off-by: default avatarMicha M <contact-micha+efoundation@posteo.de>
parent e53e2dc9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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'
+4 −1
Original line number Diff line number Diff line
@@ -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/'"