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

Commit 484cdd8d authored by Romain Hunault's avatar Romain Hunault
Browse files

Return error when build failed

parent 3607c3c1
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ if [ -d "$SRC_DIR/.repo" ]; then
  find . -maxdepth 1 ! -name "$branch_dir" ! -path . -exec mv {} "$branch_dir" \;
fi

sync_successful=true

if [ "$LOCAL_MIRROR" = true ]; then

  cd "$MIRROR_DIR"
@@ -74,6 +76,10 @@ if [ "$LOCAL_MIRROR" = true ]; then

  echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log"
  repo sync --force-sync --no-clone-bundle &>> "$repo_log"

  if [ $? != 0 ]; then
    sync_successful=false
  fi
fi

for branch in ${BRANCH_NAME//,/ }; do
@@ -135,6 +141,10 @@ for branch in ${BRANCH_NAME//,/ }; do
    builddate=$(date +%Y%m%d)
    repo sync -c --force-sync &>> "$repo_log"

    if [ $? != 0 ]; then
      sync_successful=false
    fi

    android_version=$(sed -n -e 's/^\s*PLATFORM_VERSION\.OPM1 := //p' build/core/version_defaults.mk)
    if [ -z $android_version ]; then
      android_version=$(sed -n -e 's/^\s*PLATFORM_VERSION := //p' build/core/version_defaults.mk)
@@ -259,11 +269,19 @@ for branch in ${BRANCH_NAME//,/ }; do
            echo ">> [$(date)] Syncing mirror repository" | tee -a "$repo_log"
            cd "$MIRROR_DIR"
            repo sync --force-sync --no-clone-bundle &>> "$repo_log"

            if [ $? != 0 ]; then
              sync_successful=false
            fi
          fi

          echo ">> [$(date)] Syncing branch repository" | tee -a "$repo_log"
          cd "$SRC_DIR/$branch_dir"
          repo sync -c --force-sync &>> "$repo_log"

          if [ $? != 0 ]; then
            sync_successful=false
          fi
        fi

        if [ "$BUILD_OVERLAY" = true ]; then
@@ -408,3 +426,7 @@ if [ -f /root/userscripts/end.sh ]; then
  echo ">> [$(date)] Running end.sh"
  /root/userscripts/end.sh
fi

if [ "$build_successful" = false ] || [ "$sync_successful" = false ]; then
  exit 1
fi