branch=$(git branch -r | awk -F/ '{ print $NF }' | grep ^core | sort --version-sort | tail -n1)
fi
- # If the branch was not updated, we won't build
local commit_new="$(git rev-parse origin/${branch})"
- [ "${commit_old}" = "${commit_new}" ] && return 2
+
+ # If the branch was not updated, we won't build
+ if [ ! -e "${dir}/.force-build" ] && [ "${commit_old}" = "${commit_new}" ]; then
+ return 2
+ fi
local current_branch="$(git rev-parse --abbrev-ref HEAD)"
if [ "${current_branch}" != "${branch}" ]; then
local build="${build_path}/${target}"
local status="failed"
- # Ready for build
- ./make.sh --target="${target}" clean
-
- # Download the toolchain if required
- ./make.sh --target="${target}" gettoolchain || continue
-
- # Download all sources
- ./make.sh --target="${target}" downloadsrc || continue
+ # Ready for build: Download toolchain and sources
+ for action in clean gettoolchain downloadsrc; do
+ if ! ./make.sh --target="${target}" "${action}"; then
+ touch "${dir}/.force-build"
+ continue
+ fi
+ done
# Execute the build
mkdir -p "${build}"
fi
mv -v log/ "${build}"
- # Cleanup the build environment
- ./make.sh --target="${target}" clean
-
# Upload the result
sync
# Send an email notification
send_email "${status}" "${target}" "${branch}" "${commit_new}" "${build}"
+
+ # Cleanup the build environment
+ ./make.sh --target="${target}" clean
done
popd