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

Commit a2132740 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Allow removing source code before build

parent 4190f81d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ ENV CLEAN_OUTDIR false
# For example, '0 10 * * *' means 'Every day at 10:00 UTC'
ENV CRONTAB_TIME 'now'

# Clean source code before build
ENV CLEAN_SRC_BUILD false

# Clean artifacts output after each build
ENV CLEAN_AFTER_BUILD true

+6 −0
Original line number Diff line number Diff line
@@ -128,6 +128,12 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then

  android_version_major=$(cut -d '.' -f 1 <<<$android_version)

  if [ "$CLEAN_SRC_BUILD" = true ]; then
    echo ">> [$(date)] Cleaning source code"
    rm -rf "$SRC_DIR/$branch_dir"
    rm -rf "$CCACHE_BASE_DIR/$branch_dir"
  fi

  mkdir -p "$SRC_DIR/$branch_dir"
  cd "$SRC_DIR/$branch_dir" || return 1