| # Copyright (c) 2020 Linaro Limited |
| # SPDX-License-Identifier: Apache-2.0 |
| # Save off where we started so we can go back there |
| du -hs /var/lib/buildkite-agent/* |
| if [ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" ]; then |
| git fetch -v origin ${BUILDKITE_PULL_REQUEST_BASE_BRANCH} |
| git config --local user.email "builds@zephyrproject.org" |
| git config --local user.name "Zephyr CI" |
| git merge --no-edit "${BUILDKITE_COMMIT}" || { |
| echo "Merge failed: ${merge_result}" |
| mkdir -p /var/lib/buildkite-agent/zephyr-ccache/ |
| # create cache dirs, no-op if they already exist |
| mkdir -p /var/lib/buildkite-agent/zephyr-module-cache/modules |
| mkdir -p /var/lib/buildkite-agent/zephyr-module-cache/tools |
| mkdir -p /var/lib/buildkite-agent/zephyr-module-cache/bootloader |
| # Clean cache - if it already exists |
| cd /var/lib/buildkite-agent/zephyr-module-cache |
| find -type f -not -path "*/.git/*" -not -name ".git" -delete |
| find -name index.lock -delete |
| # return from where we started so we can find pipeline files from |