crosvm/ci/kokoro/simulate
Dennis Kempin e9aa5f9598 Fix ./ci/kokoro/simulate
Somehow, after rsyncing the whole directory, git will no longer work in the
copy. So instead, we are now using 'git clone'.
This changes the behavior to not include local workspace modifications in
kokoro simulations. Which is ok, we have test_all for that and the behavior
will more closely match what's happening in kokoro presubmits.

BUG=None
TEST=./ci/simulate_all

Change-Id: I439b9eadcac65d99782e2b0eb869519abb2ada37
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3152425
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2021-09-15 17:06:48 +00:00

34 lines
856 B
Bash
Executable file

#!/bin/bash
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Simulates a Kokoro run executing one of the build-*.sh scripts.
# e.g. ./ci/kokoro/simulate build-aarch64.sh
#
# For ease of use, just call: ./ci/kokoro/simulate_all
crosvm_src=$(realpath $(dirname $0)/../../)
kokoro_root=$(mktemp -d)
kokoro_src="${kokoro_root}/src/git/crosvm"
cleanup() {
rm -rf "${kokoro_root}"
}
main() {
echo "Copying ${crosvm_src}/ to ${kokoro_src}"
mkdir -p "${kokoro_src}"
git clone -q "${crosvm_src}" "${kokoro_src}"
# Run user-provided kokoro build script.
export KOKORO_ARTIFACTS_DIR="${kokoro_root}/src"
echo "Running $1 on:"
git log --max-count=1
bash $(dirname $0)/$1
echo "$1 returned $?"
}
trap cleanup EXIT
main "$@"